我使用导体框架来运行我的测试,并且我想使用PhantomJS运行这些测试。尽管PhantomJS安装在预期的目录中,售票员仍在抱怨它没有安装。
测试中的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发布于 2015-11-23 18:33:13
您可能没有实际安装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");
}
}https://stackoverflow.com/questions/33875569
复制相似问题