Selenium webdriver "Error communicating with remote browser. It may have died" when I run test in parralel - selenium

I am working on client side. I have created around 150 test scripts. But during execution, after some script execution, Selenium throws below error and it close the browser. Time is not a fix for this error. It comes when I am executing all the test scripts together in parallel.
The error shows on Google Chrome and Firefox browsers. I am using selenium-server-standalone-2.26.0.jar file and doing execution on FF 13.0.1 version. I have also tried with FF version 14, but I get the same error. My client is not happy with this error because we dont have workaround for this issue.
**Error message:**
Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException: Error communicating with the remote browser. It may have died

I think this will happen when you dealing with popup window.
Example
Working on main window clicking on something leads to open a new popup
switch the control to popup window & do your operations in pop-up
Most of the cases popup will be closed automatically after some action performed in it. (EX : Login with facebook option most of site now a days, after entering user credential no need to close that popup it will be closed automatically after submitting proper credentials)
After this you need to switch the control to main window again otherwise it will throws above exception.
I think your doing some operations without having the control over a window.

Related

Selenium 2.53 is not throwing exception when browser is not invoked using driver.get() & driver. Navigate.To()

I used selenium 2.53.1 and tried invoking browser but browser throws Windows authentication pop up. Once Windows authentication pop up comes driver.get() will throw exception in selenium 2.42 but the same scenario is not working in 2.53. Driver is not throwing any exception and stays idle for long time in 2.53
Browser used firefox.
Eg: url
driver. Get("https://www.engprod-character.net/");
Windows Authentication pop up window occur expection requires user credentials.
In selenium 2.42 : as driver is unable to invoke browser it throws exception, so that i catch that exception and handle the authentication pop up by using robot fw code.
Browser : firefox 29
In selenium 2.53: driver is not throwing any exception. So i couldn't able to handle it.
Browser : Firefox 46
Why selenium 2.53 is not throwing exception. Do we have any alternate other than using autoIT.
Please check that you set system property ("webdriver.gecko.driver"). Otherwise Firefox could be opened without any further action.
I can't open your link https://www.engprod-character.net/ please check it too.
I don't know autoit. I only can say that Selenium is a web testig-framework working for
Java
C#
Ruby
Javascript
Python
Perl
Hope this helps?
EDIT: And I recommend to handle a popup in another way. I don't know the source code of your test object but if it's a java popup Selenium can't read it.
In this case, use
driver.switchTo().alert().sendKeys("<username>");
action.sendKeys(Keys.TAB);
and in the same way send Password and ENTER.
Another way is to overcome the authentication by adding credentials to UR, described in HTTP Basic Authentication credentials passed in URL and encryption
Good Luck!
driver.get() throws exception when Windows pageload timeout is expired it throws exception then we can catch tge exception and execute the robot class code to hansle Windows authentication pop up

Saucelabs tests block on browser allow dialog

My web app uses IndexedDB and I'm testing on SauceLabs. Some months back my tests ran but now they block on a browser dialog that says "http://gbserver3.cs.unc.edu/" wants to: store files on this device", with an Allow button.
This is Win7 and Chrome or Firefox. Likely others too.
How can I dismiss or prevent this dialog?
Update: I have discovered that if I don't ask for quota I don't get the popup and my tests succeed. I'd still like to learn how to get rid of that dialog.
we are using Nightwatch.js in our project and we were facing the same issue.
What actually did the trick was using --unlimited-storage switch when launching the browser.
(List of other command line switches for Chromium can be found here)

How do I detect that SSL is broken on a page, using Selenium

We have pages where we occasionally see compromised SSL certificate because of third party scripts that load non HTTPS resources (Initially they're fine but they occasionally change). We would like to test those pages for broken SSL every day.
We have tried one approach, attempting to catch a pop-up message that would indicate that we have insecure content on the page. However, we have been unsuccessful in simulating the pop-up message through selenium. It appears that selenium has automatically disabled any popups. While we have identified a Selenium method to disable the suppression of the pop-ups(disable-popup-handler) but we have not been able to successfully see the popup even using this method.
Has anyone found a way to detect broken SSL pages using Selenium?
You need to load a browser profile (with WebDriver) that doesn't have the setting for popup blocker enabled (using the Profile class and giving it the right properties). Then, you will get the Windows popup message concerning the SSL cert. If , for some reason, you cannot control the popup using WebDriver (because its limited to Action control only within the browser content window) then you can use Sikuli API to handle the dialog and export the cert to the "Downloads" dir and then copy the file to expected location for inspection. Unfortunately, if you use Sikuli, that will make your automation script sequential and not work via a RemoteWebDriver grid server and so you wont be able to run parallel tests. Hopfully, WebDriver gives you access to the dialog and so you will be able to run with RemoteWebDriver because that is the best way to go when running scripts, even if you run a browser locally.

handling showModalDialog window in selenium

I am using Selenium- JAVA to automate my application. In my application, when we click on a particular button, it actually opening a window using showModalDialog command. When we open a window using showModalDialog the java-script execution gets suspended till the window gets closed.
Problem No :1
in Internet Explorer(7,8,9), i am getting permission denied error upon clicking. I also tried executing javascript. For this also i got permission denied error. Any idea about this issue?
Problem No:2
In Firefox, i executed the same script and it is working fine. But the problem here is execution is suspended and it will not execute the other commands till the model window gets closed.:( How to solve this issue?
You will have to do modifications in selenium browser bot js-IEBrowserBot.prototype.modifyWindowToRecordPopUpDialogs to handle the modal window-this will help Try this. Or try using webdriver.
Can you post the application HTML you are getting this error on?

How to handle https security warning in IE for selenium rc test on ie

I am getting a warning like this when testing with selenium rc on IE Browser. Is there a command I can use to wait for it and click yes? Changing the Trusted Sites is not an option.
http://windowsxp.mvps.org/images/elevdialog.JPG
What we do is leverage a freely available tool called autoit which can interact with the windows component object model. If you are expecting the dialog you can invoke it with an exec and then proceed with selenium commands. If you want to catch unexpected ones, what we do is execute our selenium commands in a thread and if they time out we then run autoit having it return 0 or 1 depending if it finds a dialog and take things from there.
You are going to have to go into the IE Options and tweak the trusted sites so that it has those 2 sites. Once that has been done then you should be fine.