protractor icon indicating copy to clipboard operation
protractor copied to clipboard

Not able to start firefox for protractor automation angular 2 + angular cli

Open SURENDARREDDY opened this issue 9 years ago • 7 comments

I am using the following npm command to run the automation tests.

webdriver-manager clean && webdriver-manager update && ng e2e

I have firefox as one of my multiCapabilities for protractor.conf.js.

But I could not able to launch firefox. It is throwing the following error.

[17:37:20] E/launcher - Unable to parse new session response: {"value": {"sessionId":"389d1b05-d48b-3e4d-8ba6-a763a75f6719","value":{"acceptInsecureCerts":false,"browserName":"firefox","browserVersion":"52 .0.2","moz:accessibilityChecks":false,"moz:processID":8904,"moz:profile":"/var/folders/md/9vtqtrxs4f52kl2dsymc5w1mjn7g_z/T/rust_mozprofile.LeFhKUQqBlZN","pageLoadStrategy":"normal","platformName":"darwin", "platformVersion":"15.6.0","rotatable":false,"specificationLevel":0,"timeouts":{"implicit":0,"page load":300000,"script":30000}}}}

Note: I am using directConnect:true in configuration. If I use directConnect:false, I am getting geckodriver path error in console which I need to set it manually. I was expecting angular-cli will take care of it automatically which doesn't.

SURENDARREDDY avatar Apr 20 '17 03:04 SURENDARREDDY

Hi there!

2 things. First of all this is a "known issue", see this

Secondly I think that your question is better suited for StackOverflow or Gitter. Please ask a question there with the 'protractor' tag or post in the Gitter Channel to get help.

From the the getting help section of the README:

Please ask usage and debugging questions on StackOverflow (use the "protractor" tag) or in the Angular discussion group. (Please do not ask support questions here on Github.)

Thanks!

wswebcreation avatar Apr 20 '17 04:04 wswebcreation

Actually, this is the known issue with directConnect and the latest Firefox. We're working on a fix (which is just to update to the latest selenium), however in the meantime you can work around by not using directConnect and controlling Firefox through a selenium server.

However, then you'd run into the Zone.js issue that prevents WebDriver testing on Firefox. That one will be fixed in the 0.8.6 release of Zone.,js, which hopefully should come soon.

heathkit avatar Apr 20 '17 06:04 heathkit

Thank you @heathkit. If future direction is to use 'directConnect', will it going to support safari and IE. Because safari is also not opening with directConnect.

SURENDARREDDY avatar Apr 20 '17 15:04 SURENDARREDDY

Safari and IE will not work with directConnect. That wouldn't have even been possible until Selenium 3, which released this year. Now that it is possible, I don't know if there are plans to support it. As things are, directConnect only works with Chrome, and may possibly work with FF again in the future. The reason directConnect can be so troublesome is that it uses the JS selenium client to talk directly to the browser driver. This client is still a bit unstable after the big Selenium 3.0 release, and it tends to be very sensitive to the browser version.

I generally recommend people use selenium standalone where possible. The selenium server actually does a lot of work to translate between different versions of the WebDriver protocol, and it's usually more updated and reliable when it comes to supporting different browsers. It's a little more effort to set up (though it should just be as easy as webdriver-manager start), but it's a lot more reliable.

heathkit avatar Apr 20 '17 17:04 heathkit

Thanks again for clarification @heathkit. Just want to conclude, I can use directConnect: false in order to run all the browsers. Is this right?

SURENDARREDDY avatar Apr 20 '17 17:04 SURENDARREDDY

You can just leave directConnect out of your config. You'll need seleniumAddress: "http://localhost:4444/wd/hub", and then you'll need to be running a selenium server with webdriver-manager start. The protractor cookbook is a good example of how to set that up.

heathkit avatar Apr 20 '17 18:04 heathkit

The issue with directConnect in 5.1.1 is here: https://github.com/angular/protractor/issues/4253

heathkit avatar May 01 '17 02:05 heathkit