TestNG で Selenium Grid を使用して Web サイトをテストしています。Selenium IDE からエクスポートしたテスト コードは正常に動作します。私の問題は、テストが並列ではなく順次実行されていることです。
コードは次のとおりです。
public class test{
@BeforeMethod
public void startSession()
{
ThreadSafeSeleniumSessionStorage.startSeleniumSession("localhost",4444,"*firefox","url" );
}
@AfterMethod(alwaysRun = true)
public void closeSession() throws Exception
{
ThreadSafeSeleniumSessionStorage.closeSeleniumSession();
}
@DataProvider(name = "test")
public Object[][] test()
{
return new Object[][]{
{test1,null},
{test2,null},
};
}
@Test(dataProvider = "test")
void testen(String value1, String value2) throws Exception
{
ThreadSafeSeleniumSessionStorage.session().open("url");
.
.
.
.
.
ThreadSafeSeleniumSessionStorage.session().waitForPageToLoad("30000");
}
}
私のtestng.xmlは次のようになります:
スイート thread-count="5" skipfailedinvocationCounts="false" verbose="1" name="コマンド ライン スイート" junit="false" parallel="methods" 注釈="JDK"
私は何を間違っていますか?複数の Selenium RC が開始されていますが、テストは 1 つの Selenium RC でのみ実行されます。
誰かが私を助けてくれることを願っています、それは本当に重要です。
ありがとう!