Selenium IDE 1.10.0 を使用してテスト ケースを記録しました。ケースを Java/TestNG/Remote Control としてエクスポートしました。
私の Eclipse バージョンは 4.2.0 で、TestNG プラグイン バージョン 6.8 をインストールしました
このエクスポートされたテスト ケースを実行するために、Eclipse 内でプロジェクトを作成するにはどうすればよいでしょうか?
手順を教えていただくか、オンライン チュートリアルやドキュメントを共有してください。ありがとう!
以下は、Eclipse によって生成された Java コードです。
package com.example.tests;
import com.thoughtworks.selenium.*;
import org.testng.annotations.*;
import static org.testng.Assert.*;
import java.util.regex.Pattern;
public class SearchDonor extends SeleneseTestNgHelper {
@Test public void testSearchDonor() throws Exception {
// set overall speed of the test case
selenium.setSpeed("4000");
selenium.open("/?html=openid");
selenium.click("css=input[type=\"submit\"]");
selenium.waitForPageToLoad("30000");
Thread.sleep(4000);
selenium.click("id=cmp_admin");
selenium.waitForPageToLoad("30000");
selenium.click("id=quicksearch_anchor");
selenium.click("css=img[alt=\"Member\"]");
selenium.waitForPageToLoad("30000");
selenium.type("id=search_name", "suzy");
selenium.click("css=input[type=\"image\"]");
selenium.click("link=Balagia, Suzy");
selenium.waitForPageToLoad("30000");
}
}