1

Bit of a long winded one....

I have a Jenkins instance running on a Linux CentOS box. I have a Jenkins job on there which should run Protractor tests using Chrome headless, I have tried a number of configurations including using Xvfb and not using Xvfb and I always get the same result where the tests start to run and do the first browser.get command but after a few seconds the tests error with:

E/protractor - Could not find Angular on page

After the tests run a HTML report is generated and all the screesnhots are blank.

Here's the relevant code and config I'm using...

my protractor conf.js

    capabilities: {
    browserName: 'chrome',
    chromeOptions: {
        args: [
            // IMPORTANT: needed due to issue with versions of selenium and chromedriver
            "--headless", 
            "--no-sandbox",
            "--window-size=1024x768"
        ]
    }
},

My jenkins config I run shell command...

npm -g install protractor
webdriver-manager update
webdriver-manager start &

Then to run the tests I use...

xvfb-run protractor --baseUrl='https://myurl.com' conf.js

I have xvfb configured in Jenkins and installed on the CentOS box. I have tried without using xvfb as apparently later versions of Chrome don't need it.

The same tests are also running headless locally on OSX without any issue so the only difference is the operating system I think.

I'm struggling to work out what else it might be.

Simon N
  • 337
  • 2
  • 13
  • 1
    did u tried running non headless mode using jenkins on sandbox machine if possible ? – Amit Jain Sep 14 '18 at 12:15
  • 1
    Thanks for pointing me in the right direction. It seems as though --headless is having issues. I used Xvfb and removed the headless flag and I have tests running. So my takeaway is that chrome headless is not supported in CentOS. – Simon N Sep 17 '18 at 00:06

0 Answers0