2

I have my current test suite for e2e tests in protractor.

To update it to run in headless chrome, I updated my protractor version which in turn updated my webdriver-manager which in turn updated the chromedriver version to the latest i.e. 2.34

  1. When running tests in headless, tests work fine.

  2. When running tests in chrome locally, the test starts -> chrome instance launches and then it keeps popping up in between when the tests are running.

It does not allow to do anything else as chrome automation browser instance keeps showing up often.

I tried downgrading the chromedriver version to 2.29 but no luck.

Has anyone faced this problem?

My current versions in test suite are as follows:

  • protractor:5.2.2
  • webdriver-manager: 12.0.6
  • chromedriver: 2.34
  • selenium-standalone: 3.8.1
  • Chrome browser being used: 63.0.3239.108
Smriti
  • 1,552
  • 3
  • 15
  • 29

2 Answers2

0

for me, headless testing with protractor works exactly as it should. There's no window popping out, I have the exact same versions.

Make sure that you have the following arguments in your protractor's config file.

 capabilities: {
        browserName: 'chrome',
        chromeOptions: {
              args: ['--headless', '--disable-gpu'] 
        }
    },

In your config file, you can try invoking the chromedriver specifically.

exports.config = {
    seleniumServerJar: '../node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.8.1.jar',
    chromeDriver: '../node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.34',
    directConnect: false, //you can try true.
sdet.ro
  • 317
  • 3
  • 12
0

You problem might be caused by difference in OS; when running a *NIX-based system like Mac OS, "--no-sandbox" should be added to the chromeOptions. When using windows, add "--disable-gpu". It cannot hurt to use both. So your capabilities in your protactor's config file would look like:

capabilities: {
    browserName: 'chrome',
    chromeOptions: {
          args: ['--headless', '--disable-gpu', '--no-sandbox'] 
    }
},

I hope this helps.

RichardN
  • 1
  • 1