19

I am using Protractor to test my angular.js app and its working great in Chrome. I had some issues getting it set up and learning the extra webdriver syntax for jasmine, but now I'm getting the hang of it and have a number of tests that are running and passing in Chrome.

Does anyone know of any way to run Protractor in Firefox or Safari or IE or Opera? I'd like to be able to run these tests against more browsers than just Chrome. I've looked through the Protractor docs on GitHub but it only shows config files for the chromeDriver. Is there such thing as a Firefox driver or a Safari driver?

PS. I don't think it'll be much help, so I'm not posting my current config file, but if it is useful, let me know and I can post it here.

tennisgent
  • 14,165
  • 9
  • 50
  • 48

1 Answers1

38

Yes! You'll need to do a little setup depending on which browser driver you want to use, but firefox and safari should be trivial. Their drivers are included in the Selenium Standalone server. Just add

capabilities: {
    'browserName': 'firefox' // or 'safari'
},

to the config file.

For IE, you need to install a separate binary, and the Selenium Standalone Server needs that binary to be in your PATH. After that, you should be able to use ie as a browsername in your config. Check out the IEDriver documentation here - http://code.google.com/p/selenium/wiki/InternetExplorerDriver

alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
Jmr
  • 12,078
  • 4
  • 39
  • 33
  • 1
    Thanks Julie! I appreciate the quick response. I also appreciate all the work you've done on protractor. It's a great framework. Beats the crap out of the old Karma stuff we had to use before. Thanks! – tennisgent Oct 09 '13 at 15:15
  • 1
    @Jmr Is it possible to run [both firefox **and** safari](http://stackoverflow.com/questions/20692008/protractor-run-multiple-tests-in-parallel-on-different-browsers?rq=1) with protractor? To solve this problem I wrote separate grunt tasks but I'm not sure that this is best solution. – Vasiliy Kevroletin Jan 12 '14 at 04:54
  • @VasiliyKevroletin This feature is currently in the works, check out this pull request. https://github.com/angular/protractor/pull/514 – rjferguson21 Feb 18 '14 at 19:26
  • 1
    check here for an example with multiple browsers https://github.com/angular/protractor/blob/master/spec/multiConf.js `multiCapabilities` – danza Feb 26 '14 at 16:34