This is a migrated thread and some comments may be shown as answers.

Verify Dialog Text fails in FireFox (HandlerDelegate not called)

8 Answers 194 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Claus
Top achievements
Rank 1
Claus asked on 29 Dec 2011, 04:02 PM
This works fine in IE but not FireFox:

http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/code-samples/html/verify-dialog-text.aspx 

I've tried both the official release and today's build (December 29 2011). We really need this to work for our tests to be meaningful.

Kind regards,
Saxo Bank A/S

Claus Topholt

8 Answers, 1 is accepted

Sort by
0
Claus
Top achievements
Rank 1
answered on 29 Dec 2011, 06:01 PM
I tried with a GenericDialog as well -- same result. Works in IE, not in FireFox.

Using Reflector, I can see that Handle() is not called at all in FireFox. Apparently because AutomationEvent_OnWindowOpened() in DialogMonitor thinks it's not a dialog. Here is the line that gets hit:

TraceInfo.DialogPlayback.WriteLine("New window detected, but not considered a dialog {0}.", new object[] { str });

Looks like a bug to me.
0
Cody
Telerik team
answered on 31 Dec 2011, 12:49 AM
Hi,

Which version of Firefox are you trying to use? If Firefox 9, you need to upgrade to our latest internal build, 2011.2.1229. I can confirm it works just fine with FF 9 and our latest internal build as demonstrated in this video: http://screencast.com/t/gES7KiY6di9.

All the best,
Cody
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Claus
Top achievements
Rank 1
answered on 31 Dec 2011, 12:29 PM
From what I can tell, your example only shows the alert being auto handled, not a HandlerDelegate being called.

We only see the HandlerDelegate being called in IE, never in FF. And it's worth noting that the HandlerDelegate is only called if UnexpectedDialogAction.HandleAndContinue. If it's set to any of the other values, the HandlerDelegate is not called.

We've tried this in FF8 and FF9.0.1 (US), using build 2011.2.1229.

Kind regards
Saxo Bank A/S

Claus Topholt 
0
Cody
Telerik team
answered on 03 Jan 2012, 06:04 PM
Hi,

I owe you an apology. When using Firefox, It is not possible to get the text out of an Alert dialog box. The fundamental technical problem is that Mozilla decided to implement their own version of "windows" and text drawing. The dialog and its text content cannot be accessed with the standard Win32 API, which is what we use for the other browsers.

You can see what I mean by using Spy++ (which comes with Visual Studio) to view the window hierarchy of IE compared to Mozilla. I've attached screen shots to demonstrate the difference. As you can see, the Mozilla Alert dialog just isn't visible to Windows at all. As a result we don't have a way of getting at the text content.

I've logged a feature request on this here. Unfortunately there's no way we can get to this in the next 5 months.

Greetings,
Cody
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Claus
Top achievements
Rank 1
answered on 03 Jan 2012, 07:39 PM
Hi and thanks for your answer.

That's really bad. Can this method be used to catch the window?:

http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/write-tests-in-code/advanced-topics/handling-html-popups-and-dialogs/firefox-dialogs.aspx 

I'd rather not spend hours trying to get it to work if you can say up front it won't work.

This whole thing is also a bit puzzling for us. This is easy as pie in Selenium, and so basically it means we can't use FF in our tests. And because of the Chrome bug mentioned in another thread, we also can't use Chrome in our tests. Telerik Testing Framework all of a sudden looks a lot like an IE testing framework, not the cross-browser product it says on the box.

Kind regards
Saxo Bank A/S

Claus Topholt



0
Cody
Telerik team
answered on 03 Jan 2012, 08:28 PM
Hi,

I can confirm that code won't get you the text you're after:

1) That code was written for Firefox 3.6. Mozilla changed their dialogs radically starting with Firefox 4.0. The the Alert dialog no longer appears within a separate Windows Win32 window. it's now being painted within the Mozilla browser window as if it were a graphic image within the main UI window.
2) Even if you downgrade to Firefox 3.6, they still didn't put the text into a standard child window that can be probed.

Kind regards,
Cody
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Claus
Top achievements
Rank 1
answered on 03 Jan 2012, 09:13 PM
Ok, so to recap: No support for FireFox popups/dialogs for the next 5+ months.

Might be an idea to update the documentation to clearly state that fact, so other people don't waste their time on this issue.

Kind regards
Saxo Bank A/S

Claus Topholt 
0
Cody
Telerik team
answered on 04 Jan 2012, 12:17 AM
Hi,

I understand where you're coming from. To be technically accurate we have "limited" support for Firefox dialogs. We do fully support its upload and download dialogs. We support the other dialogs to the extent that we will automatically detect them and automatically close them but nothing beyond that limited capability.

Kind regards,
Cody
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Claus
Top achievements
Rank 1
Answers by
Claus
Top achievements
Rank 1
Cody
Telerik team
Share this question
or