【问题标题】:Can I run PhantomJS without downloading the binary manually?我可以在不手动下载二进制文件的情况下运行 PhantomJS 吗?
【发布时间】:2021-03-21 16:28:09
【问题描述】:

我正在尝试让程序在 Windows 和 Linux 上运行,而不必一直手动下载二进制文件。我想知道是否可以通过以某种方式删除文件路径并通过 maven 添加它来移植我的测试仪?

    DesiredCapabilities dcap = new DesiredCapabilities();
    File path = new File("C:\\phantomjs-2.1.1-windows\\bin\\phantomjs.exe"); 
    System.setProperty("phantomjs.binary.path", path.getAbsolutePath());        
    WebDriver driver = new PhantomJSDriver(dcap);

【问题讨论】:

    标签: java selenium maven phantomjs


    【解决方案1】:

    您可以尝试使用WebDriverManager,它是一个自动下载必要二进制文件的 Maven 依赖项。

    【讨论】:

      猜你喜欢
      • 2011-01-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多