[英]Unable to run tests in Selenium Grid referencing Chromedriver.exe in Maven setup
As part of my project, I am bundling the whole selenium grid as part of Maven bundle.作为我项目的一部分,我将整个 selenium 网格捆绑为 Maven 捆绑包的一部分。 The following is how my POM looks.以下是我的 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>
So, what I am planning to do is execute mvn antrun:run .所以,我打算做的是执行mvn antrun:run 。 This will be followed by mvn test which runs all the Selenium tests.接下来是运行所有 Selenium 测试的 mvn 测试。 The issue I am facing here is when I run the maven antrun:run command, seleniun grid with hub and node launches.我在这里面临的问题是当我运行 maven antrun:run 命令时,带有集线器和节点的硒网格启动。 But I also wish to invoke Chromedriver.exe as all my tests are based in ChromeDriver.但我也希望调用 Chromedriver.exe,因为我所有的测试都基于 ChromeDriver。
Is there something which we can do to mimic the following我们可以做些什么来模仿以下内容
java -Dwebdriver.chrome.driver=C:\Selenium\chromedriver.exe -jar %~dp0\selenium-server-standalone.jar -role hub in POM. java -Dwebdriver.chrome.driver=C:\Selenium\chromedriver.exe -jar %~dp0\selenium-server-standalone.jar -POM 中的角色集线器。 As of now, I believe only -role hub is passed to the server jar and due to which I am not able to run any of the Selenium tests.截至目前,我相信只有 -role hub 被传递到服务器 jar ,因此我无法运行任何 Selenium 测试。
Well.出色地。 I am using webdrivermanager to solve the above issue.我正在使用 webdrivermanager 来解决上述问题。 Very sleek and easy to implement.非常时尚且易于实施。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.