【问题标题】:PhantomJS & Conductor FrameworkPhantomJS & Conductor 框架
【发布时间】:2016-02-25 19:50:10
【问题描述】:

我正在使用Conductor 框架运行我的测试,并且我想使用 PhantomJS 运行测试。即使 PhantomJS 安装在预期的目录中,Conductor 仍抱怨它不是。

我的测试中的 JUnit 配置:

@Config(browser = Browser.PHANTOMJS, url = "http://url")

日志输出:

      Nov 23, 2015 10:58:32 AM org.openqa.selenium.phantomjs.PhantomJSDriverService <init>
INFO: executable: /Users/richhunt/IdeaProjects/selenium/phantomjs
Nov 23, 2015 10:58:32 AM org.openqa.selenium.phantomjs.PhantomJSDriverService <init>
INFO: port: 48487
Nov 23, 2015 10:58:32 AM org.openqa.selenium.phantomjs.PhantomJSDriverService <init>
INFO: arguments: [--webdriver=48487, --webdriver-logfile=/Users/richhunt/IdeaProjects/selenium/phantomjsdriver.log]
Nov 23, 2015 10:58:32 AM org.openqa.selenium.phantomjs.PhantomJSDriverService <init>
INFO: environment: {}
2015-11-23 10:58:52 [main] FATAL Locomotive:705 - phantomjs not found. Download them from https://bitbucket.org/ariya/phantomjs/downloads/ and extract the binary as phantomjs.exe, phantomjs.linux, or phantomjs.mac at project root for Windows, Linux, or MacOS.

Process finished with exit code 1

【问题讨论】:

    标签: java selenium phantomjs conductor-framework


    【解决方案1】:

    您可能没有实际安装 PhantomJS?从头开始,我进行了测试,并遇到了同样的问题。然后我跑了:

    npm install -g webdriverjs phantomjs
    

    然后重新运行相同的测试,它按预期工作。

    这是我使用的测试:

    @Config(browser = Browser.PHANTOMJS, url = "http://google.com")
    public class PhantomJSTest extends Locomotive {
        @Test
        public void testPhantomJSWorks() {
            setText("[name='q']", "Test");
        }
    }
    

    【讨论】:

    • 使用 npm 在本地构建 PhantomJS 解决了这个问题。非常感谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多