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

FireFox 10 - Confirm / OnBeforeUnload dialog is missing options

6 Answers 132 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 01 Mar 2012, 03:00 AM

In FireFox 10:

I have a confirm dialog that pops up asking if I would like to resend information.

Neither the Confirm or OnBeforeUnload dialog handles it properly (Resend does not appear in the list of button labels). This problem occurs in IE as well (Window named: Windows Internet Explorer, button named: Retry) but I have gotten around it with the blind Enter KeyPress.
 
I have attempted to make a Generic dialog handler for it as well as a blind Enter KeyPress, but both have failed.

Suggestions?

Generic dialog failure log:

'2/29/2012 5:44:48 PM' - 'Fail' : 43. Handle 'Generic' dialog. -- FIREFOX
------------------------------------------------------------
Failure Information:
~~~~~~~~~~~~~~~
Timed out waiting '5000' msec. for any dialog to be handled '1'
InnerException:
System.TimeoutException: Timed out waiting '5000' msec. for any dialog to be handled '1'
   at ArtOfTest.WebAii.Win32.Dialogs.BaseDialog.WaitUntilAnyHandled(IEnumerable`1 dialogs, Int32 handleCount, Int64 timeoutMilliseconds, Boolean resetHandleCount)
   at ArtOfTest.WebAii.Design.IntrinsicTranslators.Descriptors.DialogHandlerDescriptor.Execute(Browser browser)
   at ArtOfTest.WebAii.Design.IntrinsicTranslators.Descriptors.DialogHandlerDescriptor.Execute(IAutomationHost browser)
   at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteStep(Int32 order)
------------------------------------------------------------
'2/29/2012 5:44:48 PM' - Detected a failure. Step is marked 'ContinueOnFailure=False' aborting test execution.
------------------------------------------------------------
'2/29/2012 5:44:48 PM' - Overall Result: Fail
'2/29/2012 5:44:48 PM' - Duration: [1 min: 9 sec: 337 msec]
------------------------------------------------------------
 
<<< Test-as-Step '<xxxxxedited outxxxxx>.tstest' log ends.
 
InnerException:
System.TimeoutException: Timed out waiting '5000' msec. for any dialog to be handled '1'
   at ArtOfTest.WebAii.Win32.Dialogs.BaseDialog.WaitUntilAnyHandled(IEnumerable`1 dialogs, Int32 handleCount, Int64 timeoutMilliseconds, Boolean resetHandleCount)
   at ArtOfTest.WebAii.Design.IntrinsicTranslators.Descriptors.DialogHandlerDescriptor.Execute(Browser browser)
   at ArtOfTest.WebAii.Design.IntrinsicTranslators.Descriptors.DialogHandlerDescriptor.Execute(IAutomationHost browser)
   at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteStep(Int32 order)

"Blind" return key press code (which also fails (but works in IE)):

using Telerik.WebAii.Controls.Html;
using Telerik.WebAii.Controls.Xaml;
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.Windows.Forms;
 
using ArtOfTest.Common.UnitTesting;
using ArtOfTest.WebAii.Core;
using ArtOfTest.WebAii.Controls.HtmlControls;
using ArtOfTest.WebAii.Controls.HtmlControls.HtmlAsserts;
using ArtOfTest.WebAii.Design;
using ArtOfTest.WebAii.Design.Execution;
using ArtOfTest.WebAii.ObjectModel;
using ArtOfTest.WebAii.Silverlight;
using ArtOfTest.WebAii.Silverlight.UI;
 
namespace <xxxedited outxxxxx>
{
 
    public class <xxxxxedited outxxxxx> : BaseWebAiiTest
    {
        #region [ Dynamic Pages Reference ]
 
        private Pages _pages;
 
        public Pages Pages
        {
            get
            {
                if (_pages == null)
                {
                    _pages = new Pages(Manager.Current);
                }
                return _pages;
            }
        }
 
        #endregion
     
        [CodedStep(@"New Coded Step")]
        public void <xxxxedited outxxxxx>()
        {
            Manager.Desktop.KeyBoard.KeyPress(Keys.Enter, 200);
        }
    }
}














"Blind" return key press code (which also fails (but works in IE)):

6 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 05 Mar 2012, 04:57 PM
Hi John,

This dialog appears to be unique to Firefox. We don't have a built-in dialog handler for it. The Alert handler won't work because it's not a standard Firefox Alert dialog. The Generic dialog handler won't work because they only work with standard Windows Win32 dialogs, which Firefox never shows (unfortunately).

It looks like the warning you get when the webpage tries to refresh itself and you have the setting checked shown in the attached screen shot. I believe you can eliminate this dialog all together by unchecking this setting.

Let us know if that solves your problem.

All the best,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
John
Top achievements
Rank 1
answered on 05 Mar 2012, 08:32 PM
Thanks for the response.

Nope, I don't have that checkbox selected in the FireFox options (I wish it had been that easy). As there isn't a built-in Telerik way to handle the dialog, is there a way to get Telerik focused on the dialog prior to a blind 'enter' keypress?
0
Cody
Telerik team
answered on 06 Mar 2012, 10:39 PM
Hello John,

I do not know of anyway to force keyboard focus to that particular dialog. I'd like to experiment with it myself. Is there a public URL I can access that will show me this dialog so I can study it and see what can be done about it? Also I've had some success (about 50% rate) using a Fiddler trace that you create and send to me to reproduce problems like this.

Greetings,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
John
Top achievements
Rank 1
answered on 06 Mar 2012, 11:17 PM
Sure, we have a public URL for a demo account. It doesn't reproduce the specific instance of the problem I'm having, but I can re-create the pop-up message for you to attempt to manipulate.

1) Navigate to http://www.pbisassessment.org
2) Login as 'demo', no password
3) Click the 'Support' tab
4) Click 'Find a Coordinator'
5) Choose: Country = USA, State = Alaska, City = Anchorage
6) Click 'Search'

  Once the results have displayed (it should just be one person), press F5 to refresh the screen. The Confirm dialog appears and either 'Resend' or 'Cancel' must be chosen. This is the same dialog I'm having trouble with in another area.
  I made a Fiddler trace but it was pretty uneventful. Let me know if you still need it.

Thanks,
-- John
0
Accepted
Cody
Telerik team
answered on 07 Mar 2012, 01:24 AM
Hi John,

I got it! It turns out I was wrong about our generic dialog handler. It will handle this for you. Here's a video demonstrating how I got it working:http://screencast.com/t/e79NhvUX 

I also attached the test for you to review.

Kind regards,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
John
Top achievements
Rank 1
answered on 09 Mar 2012, 08:41 PM
Excellent, at least now I know it isn't an issue with handling the dialog, it seems to be an issue with focus remaining on a frame after it is closed. I'll open another ticket for that :)

Thanks again for the clarification and excellent code samples!
Tags
General Discussions
Asked by
John
Top achievements
Rank 1
Answers by
Cody
Telerik team
John
Top achievements
Rank 1
Share this question
or