Verify Dialog Text fails in FireFox (HandlerDelegate not called)

9 posts, 0 answers
  1. Claus
    Claus avatar
    25 posts
    Member since:
    Jun 2010

    Posted 29 Dec 2011 Link to this post

    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
  2. Claus
    Claus avatar
    25 posts
    Member since:
    Jun 2010

    Posted 29 Dec 2011 Link to this post

    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.
  3. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 30 Dec 2011 Link to this post

    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.
  4. Claus
    Claus avatar
    25 posts
    Member since:
    Jun 2010

    Posted 31 Dec 2011 Link to this post

    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 
  5. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 03 Jan 2012 Link to this post

    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.
  6. Claus
    Claus avatar
    25 posts
    Member since:
    Jun 2010

    Posted 03 Jan 2012 Link to this post

    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



  7. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 03 Jan 2012 Link to this post

    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.
  8. Claus
    Claus avatar
    25 posts
    Member since:
    Jun 2010

    Posted 03 Jan 2012 Link to this post

    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 
  9. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 03 Jan 2012 Link to this post

    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.
Back to Top