这是来自硒电网。如何编写java/C#代码来并行执行。硒电网并联执行
这够了吗?
ISelenium selenium1 = new DefaultSelenium("localhost", 5555, "*iehta", "http://localhost/");
ISelenium selenium2 = new DefaultSelenium("localhost", 5556, "*iehta", "http://localhost/");
ISelenium selenium4 = new DefaultSelenium("localhost", 5557, "*iehta", "http://localhost/");
selenium1.Start();
selenium2.Start();
selenium3.Start();
因为当我运行http://localhost:4444/console有3所可用的远程控制,但即使我从上运行代码0激活遥控器。
来自蚂蚁的代码,我不明白100%。为什么参数
<arg value="-parallel"/>
?
<target name="run-demo-in-parallel" description="Run Selenium tests in parallel">
<java classpathref="demo.classpath"
classname="org.testng.TestNG"
failonerror="true"
>
<sysproperty key="java.security.policy" file="${basedir}/lib/testng.policy"/>
<sysproperty key="webSite" value="${webSite}" />
<sysproperty key="seleniumHost" value="${seleniumHost}" />
<sysproperty key="seleniumPort" value="${seleniumPort}" />
<sysproperty key="browser" value="${browser}" />
<arg value="-d" />
<arg value="${basedir}/target/reports" />
<arg value="-suitename" />
<arg value="Selenium Grid Demo In Parallel" />
<arg value="-parallel"/>
<arg value="methods"/>
<arg value="-threadcount"/>
<arg value="10"/>
<arg value="-testclass"/>
<arg value="com.thoughtworks.selenium.grid.demo.WebTestForASingleBrowser"/>
</java>
</target>
thx回答。这一切都是真实的,但在“主动遥控”下没有RC。这个可以吗? – senzacionale
开始测试后,您应该在“Active Remote Control”下看到RCs。你的代码有问题。我已经更新了我的答案。 –