无法在Selenium Grid中运行测试,引用Maven安装程序中的Chromediver.exe



作为项目的一部分,我将整个硒网格作为Maven捆绑包的一部分进行捆绑。以下是我的POM的外观。

<executions>
<execution>     
<id>default-cli</id>            
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<echo message="Helloooooooooooooooooo, maven"/>
<java classname="org.openqa.grid.selenium.GridLauncherV3"
classpathref="maven.test.classpath"
failonerror="true"
fork="true">
<arg line="-role hub"/>
</java>
<echo message="END OF TARGET1, maven"/>
<java classname="org.openqa.grid.selenium.GridLauncherV3"
classpathref="maven.test.classpath"
failonerror="true"
fork="true">
<arg line="-role node
-hub http://localhost:4444/grid/register 
-port 5555"/>
</java>
<echo message="END OF TARGET2, maven"/>
</target>
</configuration>
</execution>
</executions>

因此,我计划执行mvn-antrun:run。接下来是mvn测试,它运行所有的Selenium测试。我在这里面临的问题是,当我运行maven-antrun:run命令时,使用hub和node启动seleniun网格。但我也希望调用Chromedriver.exe,因为我所有的测试都基于Chromedriver。

我们能做些什么来模仿下面的吗

java-Dwebdriver.chrome.driver=C:\Selenium\chromediver.exe-jar%~ dp0\Selenium-server-standalone.jar-POM中的角色集线器。到目前为止,我认为只有角色集线器被传递到服务器jar,因此我无法运行任何Selenium测试。

好吧。我正在使用webdrivermanager来解决上述问题。非常时尚,易于实施。

最新更新