简体   繁体   English

硒chromedriver.exe

[英]Selenium chromedriver.exe

As part of my project setup, I have two projects one as libraries and other as Selenium. 作为项目设置的一部分,我有两个项目,一个作为库,另一个作为Selenium。 I have all the browser setup in libraries project with /src/main/resource having chromedriver.exe Selenium project has all the pagefactory classes and this project has dependency on Library. 我在带有chromedriver.exe的/ src / main / resource的Library项目中具有所有浏览器设置。Selenium项目具有所有pagefactory类,并且该项目对Library具有依赖性。 However when i am running project on slave I am getting following error message: 但是,当我在从属服务器上运行项目时,出现以下错误消息:

java.lang.IllegalStateException: The driver executable does not exist: c:\jenkins_slave10\workspace\TEST-Demos\file:\C:\Users\svc-hudson\.m2\repository\com\bskyb\automation\crm\libraries\1.1-SNAPSHOT\libraries-1.1-SNAPSHOT.jar!\chromedriver\windows\chromedriver.exe
        at com.google.common.base.Preconditions.checkState(Preconditions.java:177)
        at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:117)
        at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:112)
        at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:89)
        at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:149)
        at com.abc.automation.crm.actions.BrowserSetup.openBrowserChrome(BrowserSetup.java:38)
        at com.abc.automation.crm.actions.Search.setup(Search.java:111)
        at com.abc.automation.crm.actions.Search.directorynumber(Search.java:35)
        at com.abc.automation.crm.stepdefs.Demo.i_search_for_directory_number(Demo.java:34)

Did you try setting the system property to specify the chromedriver.exe location? 您是否尝试设置系统属性以指定chromedriver.exe位置?

Either start the selenium server with 用以下方法启动硒服务器

-Dwebdriver.chrome.driver=c:\path\to\your\chromedriver.exe 

or 要么

set the system property in your code: 在代码中设置系统属性:

System.setProperty("webdriver.chrome.driver", "C:/path/to/your/chromedriver.exe");

You should not pack chromedirver on jar. 您不应该在罐子上装chromedirver。

Try to add prebuild step in jenkins that will download chromdriver to your project folder in workspace and set relative path to it. 尝试在jenkins中添加预构建步骤,该步骤会将chromdriver下载到工作区中的项目文件夹中,并设置相对路径。

Error is saying that the path you have specified is not correct path. 错误是您指定的路径不正确。

System.setProperty("webdriver.chrome.driver", "/home/path/Downloads/chromedriver"); // specify complete path. 
WebDriver webDriver = new ChromeDriver();

Might be possible that chrome driver is not compatible with OS. chrome驱动程序可能与OS不兼容。 You have to check this. 您必须检查一下。 You can download driver from http://chromedriver.storage.googleapis.com/index.html?path=2.16/ and extract .zip file. 您可以从http://chromedriver.storage.googleapis.com/index.html?path=2.16/下载驱动程序并解压缩.zip文件。

Error is saying that the path you have specified is not correct. 错误是您指定的路径不正确。

System.setProperty("webdriver.chrome.driver", "c://jars//imp//IEDriverServer.exe"); // complete path. 
WebDriver webDriver = new ChromeDriver();

I think you are missing specify your path with double '//' like below 我认为您缺少使用双'//'指定路径的方法,如下所示

c://jars//imp//IEDriverServer.exe

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 硒找不到chromedriver.exe - selenium is not locating chromedriver.exe Java Selenium Chromedriver.exe 不存在 IllegalStateException - Java Selenium Chromedriver.exe Does not Exist IllegalStateException 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="" - Selenium WebDriver 3.0.1 chromedriver.exe 2.25 --whitelisted-ips=“” 无法在 Selenium 网格中运行测试 Maven 设置中引用 Chromedriver.exe - Unable to run tests in Selenium Grid referencing Chromedriver.exe in Maven setup 如何在没有 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 如何在 selenium 中不设置本地驱动程序的情况下启动浏览器? (不访问本地chromeDriver.exe) - How to launch browser without setting local driver in selenium? (Without accessing local chromeDriver.exe) Chromedriver.exe 被视为来自 IntelliJ 的文件 - Chromedriver.exe is viewed as a file from IntelliJ
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM