0

I followed Web page Capture and save to image using phantomjs lib and able to save screenshot on my local.

However when executing PhantomJS command with Jenkins, following error is generated: "_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL." and screen shot is not saved on Jenkins.

Can anyone please guide me?

Community
  • 1
  • 1
user2325313
  • 99
  • 2
  • 13

1 Answers1

2

I've found two possible solutions to this problem:

  1. As user2325313 commented, if you login as the Jenkins' user you should be able to avoid this issue.

  2. Run Jenkins as a standalone application instead of a daemon. To do so, locate your Jenkins .war file and execute it from the terminal using the following command :

    java -jar /Applications/Jenkins/jenkins.war

iOSCowboy
  • 1,426
  • 2
  • 9
  • 9