【问题标题】:Unable to run test script using Gecko driver(0.19.1); latest Selenium jars(3.7.1) and FF(57.0)无法使用 Gecko 驱动程序(0.19.1)运行测试脚本;最新的硒罐(3.7.1)和FF(57.0)
【发布时间】:2017-11-30 11:25:29
【问题描述】:

尝试使用 Gecko 驱动程序 (0.19.1) 在 Mozilla Firefox 中运行我的脚本;最新的硒罐(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

【问题讨论】:

  • 这不是 geckodriver 的问题。您正在提供Malformed URL: baseURL is not a valid URL。您要打开哪个网址?

标签: java selenium-webdriver selenium-firefoxdriver


【解决方案1】:
  1. 试试这个:为您的浏览器编写 FirefoxDriver.SystemProperty.DRIVER_USE_MARIONETTE,"true" 例如:

    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");正确的?

【讨论】:

    猜你喜欢
    • 2018-09-20
    • 1970-01-01
    • 2017-06-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-31
    相关资源
    最近更新 更多