Skip to content

09 Browser Setup

Biswajit Sundara edited this page Feb 23, 2021 · 4 revisions

Protractor recommends two browsers chrome & firefox. However we can also test using internet explorer.

Driver Files

In selenium we download the webdrivers and set the path, here in protractor the drivers are downloaded when we execute webdriver-manager update command. The location of the files depend on how we have installed protractor.

  • If we have installed globally then it will be available under AppData/Roaming/npm/node_modules
  • If we have setup at project level then \node_modules\protractor\node_modules\webdriver-manager\selenium
  • By default the internet explorer driver is not available as protractor doesn't recommend it.
  • If we want to test for IE then use the command webdriver-manager update --ie
  • Check the driver location and you should see IE drivers.

Default Browser

The default browser is chrome.

Firefox browser

add this in conf.js file

capabilities:{
      'browserName': 'firefox'
}

Internet Explorer browser

 capabilities:{
      'browserName': 'internet explorer'
 }

Chrome browser

No need to set anything as chrome is the default browser however if we want to apply headless option etc.

capabilities: {
    browserName: 'chrome',
    chromeOptions: {
       args: [ "--headless", "--disable-gpu", "--window-size=800,600" ]
    }
 }




https://www.protractortest.org/#/browser-setup

Clone this wiki locally