Trying to get test running on phantomjs
I have setup phantomjs on my machine by following your instructions here: http://
I'm trying to run a basic script:
#!/usr/bin/env python
from sst.actions import *
driver = webdriver.
go_to('http://
assert_
driver.quit()
This is the output:
(ENV)qa@
-------
starting SST...
date time: 2013-05-02 10:12
test directory: '.'
report format: 'console'
browser type: 'Firefox'
shared directory: None
screenshots on error: False
failfast: False
debug: False
headless xserver: False
1 test cases loaded
-------
sst.runtests.
Starting browser
ERROR
=======
ERROR: sst.runtests.
-------
_StringException: Traceback (most recent call last):
File "/home/
super(
File "/home/
self.
File "/home/
self.browser = self.browser_
File "/home/
return self.webdriver_
File "/home/
self.binary = FirefoxBinary()
File "/home/
self._start_cmd = self._get_
File "/home/
" Please specify the firefox binary location or install firefox")
RuntimeError: Could not find firefox in your system PATH. Please specify the firefox binary location or install firefox
-------
Ran 1 test in 0.022s
FAILED (errors=1)
-------
I dont have FF installed on my machine.
If I run it with -b PhantomJS I get this error.
(ENV)qa@
-------
starting SST...
date time: 2013-05-02 11:37
test directory: '.'
report format: 'console'
browser type: 'PhantomJS'
shared directory: None
screenshots on error: False
failfast: False
debug: False
headless xserver: False
1 test cases loaded
-------
sst.runtests.
Starting browser
ERROR
=======
ERROR: sst.runtests.
-------
_StringException: Traceback (most recent call last):
File "/home/
super(
File "/home/
self.
File "/home/
self.browser = self.browser_
File "/home/
return self.webdriver_
File "/home/
self.
File "/home/
raise WebDriverExcept
WebDriverException: Message: 'Unable to start phantomjs with ghostdriver.' ; Screenshot: available via screen
-------
Ran 1 test in 0.032s
FAILED (errors=1)
-------
Thanks.
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- 2013-05-02
- Last reply:
- 2013-05-03
Corey Goldberg (coreygoldberg) said : | #1 |
Hi...
> I have setup phantomjs on my machine by following your instructions here
those directions are quite dated... Ghostdriver is now part of PhantomJS itself. The easiest way to get it is to just grab a binary package of PhantomJS: http://
once you download a binary version for your system, take the "phantomjs" executable and place it somewhere on your system path (or add it's location to your system path). then webdriver will be able to find phantomsjs.
> driver = webdriver.
don't create your own driver in an sst script. the SST framework takes care of creating the webdriver object and starting the browser. so your sst script should look like this (no matter which browser you run with):
--------
#!/usr/bin/env python
from sst.actions import *
go_to('http://
assert_
--------
> (ENV)qa@
you haven't specified a browser, so it should use Firefox, not phantomjs... is firefox installed?
> (ENV)qa@
that is a correct invocation of sst-run using PhantomJS. it most likely can't find the phantomjs binary (see comment above about adding to system path).
hope that helps.
-Corey
Can you help with this problem?
Provide an answer of your own, or ask Callistus for more information if necessary.