Gho*_*leg 7 java selenium google-chrome selenium-chromedriver
我在项目文件夹中有chromedriver和chromedriver.exe.我正在使用此代码创建驱动程序实例.
ChromeOptions options = new ChromeOptions();
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
LoggingPreferences log_prefs = new LoggingPreferences();
log_prefs.enable(LogType.BROWSER, Level.SEVERE);
capabilities.setCapability(CapabilityType.LOGGING_PREFS, log_prefs);
System.setProperty("webdriver.chrome.driver", "chromedriver");
driver = new ChromeDriver(capabilities);
driver.manage().window().maximize();
Run Code Online (Sandbox Code Playgroud)
并且它在本地窗口上是可以的(如果我们将"chromedriver"更改为"chromedriver.exe"),但是当我在CentOS上运行时,我收到错误消息:"驱动程序不可执行".
| 归档时间: |
|
| 查看次数: |
17177 次 |
| 最近记录: |