How to run Robot Framework headless mode on Ubuntu server

1,759 views
Skip to first unread message

hello2...@gmail.com

unread,
May 14, 2018, 6:45:56 PM5/14/18
to robotframework-users
Hi, All,
   My test environment is Robot Framework on Ubuntu server, so we need to run headless mode. I have been working on it for couple of weeks without success. The same Robot Framework test case can be run on Mac with headless successfully. But it didn't work on Ubuntu server. Below is the code extract that works on my Mac, but not on Ubuntu server. I also tried Any thoughts and input are appreciated!

*** Settings ***
Documentation This is a basic test
Library Selenium2Library
*** Variables ***

*** Test Cases ***
User can open home page
[Documentation] as a user I can open the home page and see the tagline

Open Browser https://www.google.com/ browser=headlesschrome
Wait Until Page Contains choose settings that are right for you
close browser

*** Keywords ***

The error was:
User can open home page :: as a user I can open the home page and ... | FAIL |
WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
  (Driver info: chromedriver=2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Linux 4.4.0-121-generic x86_64)

Patty
------------------------------------------------------------------------------

Tatu Aalto

unread,
May 15, 2018, 7:33:41 AM5/15/18
to hello2...@gmail.com, robotframework-users
Ugh

Would you be able to run the test with --loglevel trace set from the command line and post the full stack trace? My gut feeling is that this is something related to Chrome or ChromeDriver so updating or downgrading few version might be worth of trying.

-Tatu
Send from my mobile

--
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-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

hello2...@gmail.com

unread,
May 15, 2018, 2:57:14 PM5/15/18
to robotframework-users
Tatu,
   Thanks much for your response and the information. Now I run the below robot test case on Ubuntu 18.04 desktop to open an url through firefox browser and it still failed. I can open the url on the Ubuntu desktop via firefox browser manually. Not sure why Robot can't open the URL via either firefox nor chrome. I ran robot with --loglevel TRACE
I attach the log files on the email. Thanks so much!

*** Settings ***
Documentation               This is a basic test
Library                     Selenium2Library
*** Variables ***

*** Test Cases ***
User can open home page
    [Documentation]         as a user I can open the home page and see the tagline

    Open Browser        http://10.108.104.30/
    close browser

*** Keywords ***


To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
log.html
output.xml

Tatu Aalto

unread,
May 15, 2018, 3:47:07 PM5/15/18
to hello2...@gmail.com, robotframework-users
Ugh

It looks like geckodriver or the Firefox did close unexpectedly when it tried to open the browser. Usually this means that Selenium, geckodriver or Firefox is not compatible with other components in the previous list. Unfortunately it's impossible to say what is incompatible with what based on the error message. To start with, I would make sure that Selenium and the geckodriver are the latest version available. Also, geckodriver creates a log file, either in the execution directory or ti the Robot Framework output directory. I would look the log file and see what type of hints it offers.


-Tatu
Send from my mobile
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.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

--
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-u...@googlegroups.com.

hello2...@gmail.com

unread,
May 15, 2018, 5:38:05 PM5/15/18
to robotframe...@googlegroups.com
Tatu,
   Thanks so much for your help!  You are a genius!!! I just run below commands to reinstall/update selenium, geckodriver and firefox. It PASSED for headless mode!!!! I am so happy. I was stuck on this for two weeks!! But it failed for non-headless mode when I start it on console. I attach the log file on the email. I appreciate your help!!! 
   
   pip install -U selenium 


     sudo apt-add-repository ppa:mozillateam/firefox-next

      apt-get update

   sudo apt-get install firefox 



 Regards,


Patty


   

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 robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

--
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.
log.html
Reply all
Reply to author
Forward
0 new messages