Watin's LogonDialogHandler not working for Firefox 3.6 - watin

I'm writing automation scripts for a website using WatiN. when I browse to a particular url, a authentication dialog pops up. I have following code to handle the dialog. This code basically enters the specified
// Create a logon dialog handler
LogonDialogHandler ldh = new LogonDialogHandler(user, password);
browser.DialogWatcher.Add(ldh);
browser.GoTo("URL that pops up the authentication dialog");
Now this works just fine in IE. But in Firefox, the dialog appears and nothing happens after that. (No username or password entered in their text boxes)
Any idea what's going wrong here?

I'm sorry but the automation of firefox popups/dialogs is not supported by WatiN at this moment (WatiN 2.1 and lower). It probably can be done but this is not high on my priority list.

Related

Selenium cannot find elements on Google service while minimalised or headless mode

I try to create a program which will automate fetching data from one of the Google services. By using chrome and watir (which is basically a Ruby library build on top of the Selenium). Everything works fine as long as I keep my browser open. But when I minimize window, my program is not even able to pass a login process since it cannot find certain elements. This is my code to login:
#browser = Watir::Browser.new :chrome, options: { detach: true }
#browser.goto BASE_URL
#browser.text_field(name: 'identifier').set USER_EMAIL
#browser.element(xpath: '//*[#id="identifierNext"]').click
#browser.text_field(xpath: '//input[#type="password"]').set USER_PASSWORD
#browser.element(xpath: '//*[#id="passwordNext"]/div/button/div[2]').click
When my browser is minimize, during attempt to set a password I get this error message:
*** Watir::Exception::UnknownObjectException Exception: element located, but timed out after 30 seconds, waiting for
#<Watir::TextField: located: true; {:xpath=>"//input[#type="password"]", :tag_name=>"input"}> to be
present
And it works just fine as an open window. Even if I maximize the window during whole process program is suddenly able to locate missing input fields. The same story goes in many other points further. Program is not able to locate some elements unless chrome window is open.
Needless to say it works even worse in headless mode and I'm basically not able to locate any of those elements in html code.
As far as I understand Google services frontend side are build with Angular framework which inject html code dynamically. But shouldn't selenium pretend to act like a regular user and trigger the same responses on minimized and open window (and the headless mode as well)?
Is is some kind of blockade from Google to prevent this kind of automated proces and how can I bypass it?
Is this an issue with Chrome and switching for e.g. Firefox would fix it?
Can I implement some additional actions to actually mimic human interaction and pretend that my Chrome window is open?

Selenium not sending spacebars to application

I am using Selenium IDE 2.8.
I am a tester and using firefox to test a php based application with ajax.
There is a point in the application where three space bars are entered into the textfield and ajax will fetch all data and display a seperate bit of css displaying the information.
Enter 3 spaces in the textfield, information then appears.
For some reason on playback this 'three space bar key press' event isn't called or indeed reaches the texfield....nothing happens, ajax has nothing to do and the info that my selenium script is waiting for doesn't appear and promptly fails.
There is nothing to 'waifFor...' etc.
Any suggestions?
Thank you!
use sendKeys command instead of type

Accept Untrusted Certificates on anonymous profile in firefox

I have a small issue.I am opening a firefox browser in a specific profile with selenium,and an flash app
appear.In this app I need to click something,so I use sikuli.The problem is when clicking a button with sikuli,my app opens a browser in an anonymous profile so the "Untrusted SSL certificates" appears.
Is there any way to setAcceptUntrustedCertificates for anonymous profiles for firefox ?
I want to mention that I already have setAcceptUntrustedCertificates in my java code.
Thanks
You need to create a profile for the driver and use
profile.setAcceptUntrustedCertificates (true);
Also this has been answered before for example see
Handling UntrustedSSLcertificates using WebDriver

AJAX not getting invoked through QTP

I am working on QTP 11. I my current project I am trying to automate a website with AJAX fields. I my project I have a text field on which if we try to enter characters then AJAX table appears and we have select a suitable value from the below table. I am able to check the existence of AJAX table.
The problem is to set the text field through QTP, AJAX is not getting invoked. But manually it is working properly. Also, if I first try manually and then I try to enter any through the script, then also it is working properly. It is not possible for me to check each field manually then enter it through script. So can any body tell how AJAX can be invoked on first try without any manual intervention?
I have tried to Set property, Keyboard events like WScript.shell, Mercury.DeviceReplay and AutoIt, however none of them are working. Are there any keyboard input methods that I have missed out?
Can somebody please help me out?
Try performing a WebEdit.Click on the text field in question. If this doesn't work it means that the web page is expecting some events that QTP didn't fire in this case you should change to device replay mode
Setting.WebPackage("ReplayType") = 2
Browser(...).Page(...).WebEdit(...).Click
Setting.WebPackage("ReplayType") = 1
I had the same issue, not recognizing the web list (not selecting the item from list). Using QTP 11.5 loaded with web toolkit 2.0, ASPAjax, DOJO, JQuery add-ins. Still showing the same behavior.
However there is nothing wrong with the code, if I give some wait the code is working OK.

Watin - problems with page redirects

I'am trying out Watind. I am having problems with a Login page og the applciation, which automatically redirects to the main page (without any user intervention). It looks like WatiN has troubles with this. Wehn I Invoke:
IE ie = new IE("http://localhost/MyApp/Login.aspx");
The browser opens, it redirects to "Main.aspx", but Watin times out with "Timeout while Internet Explorer state not complete". While debugging, I have found out, that method IEReadyStateIsComplete. When trying to evaluate ie.ReadyState, its is getting the following exception from ie: "The Object has disconnected from its clients".
I am using IE8.
Any ideas how to handles fast redirects?
Matra
It looks like the problem was related to UAC feature of Window 2008 server. I'have restarted VS200 as an Administrator and now it works OK.

Resources