Regarding PhantomJS

118 views
Skip to first unread message

JaYa

unread,
Nov 9, 2016, 3:30:02 AM11/9/16
to robotframework-users
I am exploring headless browser automation using robot framework.


when i execute sample script which has below coding:

Getting below error:


Starting test: Test Example.Test_gmail
20161109 13:39:11.610 :  INFO : Opening browser 'phantomjs' to base url 'https://calendar.google.com/calendar/render?pli=1#settings-general_11'
20161109 13:39:11.636 :  FAIL : No browser is open
20161109 13:39:11.639 :  WARN : Keyword 'Capture Page Screenshot' could not be run on failure: No browser is open
20161109 13:39:11.640 :  FAIL : 
WebDriverException: Message: 'phantomjs' executable needs to be in PATH



*****

Does anyone worked on headless browser automation using phantomJS+ Robot Framework?

Please redirect me to the correct steps to be followed and if you any web page links which are self explanatory 



Nesat Ufuk

unread,
Nov 9, 2016, 7:39:09 AM11/9/16
to robotframework-users
Hi,

Take a look at the Ghostdriver . I am using it for my headless tests

Hélio Guilherme

unread,
Nov 9, 2016, 7:49:42 AM11/9/16
to robotframework-users
You just have to use Selenium2Library using Open Browser     URL     browser=phantomjs.

(Sometimes is better to use Create Webdriver)

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframework-users@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

dm08

unread,
Nov 9, 2016, 10:47:12 AM11/9/16
to heliox...@gmail.com, robotframework-users
His problem was 

WebDriverException: Message: 'phantomjs' executable needs to be in PATH

And I believe it is because he did not install phantomjs 


To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.

JaYa

unread,
Nov 9, 2016, 12:21:02 PM11/9/16
to robotframework-users
Please let me know, how to install phantomjs on mac as well as on linux.

On linux i tried apt-get install phantomjs.

After installation also , it has give this warning msg

20161109 13:39:11.639 :  WARN : Keyword 'Capture Page Screenshot' could not be run on failure: No browser is open


Hélio Guilherme

unread,
Nov 9, 2016, 12:33:36 PM11/9/16
to robotframework-users
Download the executable and place it within the reach of PATH.

stn1k3

unread,
Nov 9, 2016, 12:36:00 PM11/9/16
to heliox...@gmail.com, robotframework-users
brew install phantoms

To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.

Shailaja(Riya)

unread,
Nov 10, 2016, 1:26:32 AM11/10/16
to robotframework-users
Thanks all, i worked for me.


My next exercise is to execute all test cases which are coded in robot framework using PhantomJs.

My script after login checks title of page using robot keyword " Wait Until Page Contains".

When i execute the test cases its getting failed with below error:

20161110 11:49:56.212 :  INFO : Opening browser 'phantomjs' to base url “URL of our site'

20161110 11:51:08.202 :  INFO : </td></tr><tr><td colspan="3"><a href="selenium-screenshot-1.png"><img src="selenium-screenshot-1.png" width="800px"></a>

20161110 11:51:08.203 :  FAIL : Text ’Title of OUR Site' did not appear in



Could any one let me know, for executing robot test cases with phantomjs , do we need to do any modification( apart from browser name as 'phantomjs' in Open Browser keyword)

JaYa

unread,
Nov 10, 2016, 1:32:01 AM11/10/16
to robotframework-users
Hello,

brew install phantoms, worked well.

Followed below steps for creating symlink.


Thanks you so much to everyone who helped to solve the issue ..




On Wednesday, November 9, 2016 at 2:00:02 PM UTC+5:30, JaYa wrote:
Reply all
Reply to author
Forward
0 new messages