简体   繁体   中英

PhantomJS & Conductor Framework

I'm using the Conductor framework to run my tests, and I want to run the tests with PhantomJS. Even though PhantomJS is installed in the expected directory, Conductor is complaining that it isn't.

JUnit config on my test:

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

Log Output:

      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

You may not have PhantomJS actually installed? From scratch, I ran a test, and got the same issue. I then ran:

npm install -g webdriverjs phantomjs

And re-ran the same test, and it worked as expected.

Here is the test I used:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM