【问题标题】:impossible to run a test through the selenium RC on chrome不可能通过 chrome 上的 selenium RC 运行测试
【发布时间】:2013-04-13 00:47:51
【问题描述】:

我通过 selenium RC 运行测试,它工作正常。我使用这个命令行:

java -jar selenium-server-standalone-2.32.0.jar -firefoxProfileTemplate "SeleniumProfile" -htmlsuite "*firefox" "https://www.google.com" "testSuite1.html" "result.html"

我尝试通过将“*firefox”替换为“*googlechrome”来在 chrome 上运行相同的命令,但它失败了:

Chrome 已打开,但显示以下消息:“您正在使用不受支持的命令行标志:--disable-web-security。稳定性和安全性将受到影响”

我通过在命令行中删除 -firefoxProfileTemplate "SeleniumProfile" 得到了相同的结果。

您知道我必须修改什么才能使其正常工作吗? 预先感谢, 托马斯。

【问题讨论】:

    标签: google-chrome selenium selenium-rc


    【解决方案1】:

    我认为你必须指向 Chrome 驱动程序,所以添加这个:

    -Dwebdriver.chrome.driver=C:\grid2\chromedriver.exe
    

    在此处下载驱动程序:https://code.google.com/p/chromedriver/downloads/list 并根据需要修改路径。

    当然,您必须删除 Firefox 配置文件引用。

    希望对你有帮助。

    【讨论】:

    • 对不起,我没有看到答案,我会尽快尝试。谢谢
    • 感谢您的建议 - 尝试过 - 没有任何区别。我需要告诉 PHPUnit 做一些不同的事情吗?
    【解决方案2】:

    您可以添加以下两行来修复此错误:-

    System.setProperty("webdriver.chrome.driver", "C:\Users\Administrator\Documents\selenium\chromedriver_win32\chromedriver.exe");
    WebDriver driver = new ChromeDriver();

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-07-27
      • 1970-01-01
      • 1970-01-01
      • 2013-04-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-25
      相关资源
      最近更新 更多