handling showModalDialog window in selenium - 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?

Related

Recording Tests in TestCafe using PIV Card Technbology

Using TestCafe, when running a test suite that already exists, and includes a signin function that clicks through and works successfully using PIV Card authentication and code that was written manually all works well. However, in the essence of speed, I was hoping to record tests using the TestCafe Studio software to get it done quicker than manually doing it.The issue we are running into, if I click "record a new test" on an existing test script, it attempts to run through the existing signin code, (which works if you run it as a normal test executing and not recording), it fails on logging in. I believe it's due to the nature of PIV. I was wondering, is it possible with testcafe studio, a setting perhaps that might maintain state of a logged in session rather than killing it at each test start? I'm already logged in with my PIV when I start the test, but it's appearing to log me out at the start of each session. Anyone have experience with this and know what I can do to make it remember me when I run a new test?
If I correctly understand your usage scenario, you are running tests using a user profile, which is already logged in. Unfortunately, TestCafe Studio does not have a mechanism for launching recording with profiles, as well as launching a browser with any options in general.
I can suggest you the following workaround:
Turn off the code responsible for the login when recording the script.
Use the await t.debug() function instead of login.
When the test starts, wait for the debug panel to appear in the browser and unlock the page:
Sign in manually.
Click Resume on the debug panel.
Write down your script.
Replace await t.debug() with a login function.

Selenium chrome driver throws password field not intractable error

I am using selenium chrome driver nugget package with . Net core for browser automation. I am facing an issue whenever I try to set text inside password field. I tried to implement most of the suggestions on stackoverflow and other sites but nothing seems working. I tied to use wait.until elements is visible and wait.until elements is clickable and tried sleeping the current thread for considerable time but none of the solution is working.
I am not getting this error while debugging it. Please help if you have solution around it.

Firefox stuck at Login operation with Selenium-Webdriver

I'm trying to execute Selenium-webdriver code written in Ruby for firefox.
I'm using firefox 45.0.1 because I use ruby 2.1.10 and Selenium-WEbdriver-2.53.4
When I execute Selenium opens firefox, enters address and enters username and password and hits login button.
But after that It stays there with loading symbol near login and also browser says
Transferring data from 34.23.23.2
Selenium is stuck here for 5 minutes and then exists saying timeout and gives below error.
**1.1) Failure/Error:**
#browser.span(:text=>'Login').wait_while_present(10000)
Net::ReadTimeout:
Net::ReadTimeout
When I manually open firefox new tab when selenium opens the firefox and try to login manually, I see the same issue. But When I open firefox manually from desktop and login it works. Please tell me what I'm I missing here.
I suspect that some websites detect when a automated test is running and behave differently, also when selenium starts up it uses a default profile and when you open it manualy your profile is loaded. Cant say for sure that's your problem.

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)

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

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.