尝试使用Gecko驱动程序在Mozilla Firefox中运行我的脚本(0.19.1);最新的Selenium罐子(3.7.1)和FF(57.0);
浏览器启动但URL未在浏览器中运行;屏幕如下图所示 enter image description here
此欢迎页面始终显示,在控制台中,它将日志显示为:
Exception in thread "main" org.openqa.selenium.InvalidArgumentException: Malformed URL: baseURL is not a valid URL.
Build info: version: '3.7.1', revision: '8a0099a', time: '2017-11-06T21:07:31.527Z'
System info: host: 'BIZ4SOL-8', ip: '192.168.1.67', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_31'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 56.0, javascriptEnabled: true, moz:accessibilityChecks: false, moz:headless: false, moz:processID: 6688, moz:profile: C:\Users\pratik\AppData\Loc..., pageLoadStrategy: normal, platform: XP, platformName: XP, platformVersion: 6.1, rotatable: false, specificationLevel: 0, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}}
Session ID: 7af514e7-7f11-44cb-a15d-e50aaf431874
答案 0 :(得分:0)
试试这个:为你的浏览器写一个FirefoxDriver.SystemProperty.DRIVER_USE_MARIONETTE," true" e.g:
FirefoxOptions options = new FirefoxOptions();
System.setProperty ("webdriver.gecko.driver", "path_to_driver/geckodriver.exe");
System.setProperty(FirefoxDriver.SystemProperty.DRIVER_USE_MARIONETTE,"true");
driver = new FirefoxDriver(options);
2.你使用driver.get(" url");正确?