简体   繁体   English

无法在 Selenium 网格中运行测试 Maven 设置中引用 Chromedriver.exe

[英]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.

相关问题 硒chromedriver.exe - Selenium chromedriver.exe 硒找不到chromedriver.exe - selenium is not locating chromedriver.exe 使用Chrome驱动程序2.36.540470和Selenium无法在本地使用maven在Jenkins中运行Java Selenium测试 - Unable to run Java Selenium tests in Jenkins locally using maven using ChromeDriver 2.36.540470 and Selenium Java Selenium Chromedriver.exe 不存在 IllegalStateException - Java Selenium Chromedriver.exe Does not Exist IllegalStateException 使用远程“ chromedriver.exe”文件设置Chrome WebDriver - Setup Chrome WebDriver with remote 'chromedriver.exe' file Selenium Java:当程序退出时保证chromedriver.exe关闭 - Selenium Java: Guarantee chromedriver.exe shutdown when program exits chromedriver.exe和selenium-chrome-driver.jar之间的区别 - difference between chromedriver.exe and selenium-chrome-driver.jar Selenium WebDriver 3.0.1 chromedriver.exe 2.25 --whitelisted-ips=&quot;&quot; - Selenium WebDriver 3.0.1 chromedriver.exe 2.25 --whitelisted-ips=“” 如何在没有 ChromeDriver.exe 的情况下从 Selenium 远程 Web 驱动程序启动 GoogleChrome - How to Launch GoogleChrome from Selenium Remote Web Driver without ChromeDriver.exe 我可以使用getResource打开chromedriver.exe(FireFox / IE)吗? *硒Java - Can I open the chromedriver.exe (FireFox / IE) using getResource? *Selenium-Java
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM