1

Can't get my protractor running on remote server on headless mode. I'll be glad if anyone could help

  • This is my qa server setting:

Under /etc/init.d/xvfb script to stat Xvfb :99

export DISPLAY=:99 set in bash_profile ( echo $DISPLAY returns :99)

firefox and protractor installed.

  • My project pom.xml:

I'm using maven-wagon-plugin to execute

  1. The script starting xvfb on display:99 on my qa server
  2. Run protractor protractorTest/conf.js on my qa server

When running the job from jenkins

=> I'm getting error E/launcher - Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms.

Firefox console output: Error: no display specified

Checked if the xvfb is running:

ps -ef | grep Xvfb on QA server shows the Xvfb process running, but

Please let me know if something is wrong or missing?

Community
  • 1
  • 1
sou
  • 21
  • 3
  • 1
    Try running your protractor test using `xvfb-run`. Try the below command in terminal. `xvfb-run protractorTest/conf.js` – Sudharsan Selvaraj Oct 17 '16 at 05:04
  • 1
    thank you, I found out why it was not working. I had to start the xvfb in the same script that is running protractor. I used maven wagon plugin to execute the command that starts the xvfb + runs protractor tests – sou Nov 02 '16 at 16:33
  • Possible duplicate of [Error in running cucumber-jvm selenium test cases in headless mode under jenkins build](https://stackoverflow.com/questions/27511124/error-in-running-cucumber-jvm-selenium-test-cases-in-headless-mode-under-jenkins) – kenorb Aug 23 '17 at 15:25

1 Answers1

0

The xvfb need to start in the same script that is running protractor. So Maven wagon plugin can be used to execute the command that starts the xvfb + runs protractor tests.

Source: @sou comment.

kenorb
  • 155,785
  • 88
  • 678
  • 743