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

Handle confirm dialog fails in Firefox 20.

8 Answers 171 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 11 Apr 2013, 11:02 PM
Just ran into this today and was pretty sure I had this working on another test, though it failed when I tried running said test.
Found some simple code from another support post and trimmed it down for a test case.
Telerik version is 2012.2.1527.0
The firefox http client shows up as 2012.2.1205.0

Is this something that I would have to use a coded step for to handle FF's trickery?
In IE10 the dialog is handled.

In FF20 when the dialog pops up, it sits there and times out.

Here is some example html/js that I used for a test case on the simple confirm handler.
<html>
<head>
<script type="text/javascript">
<!--
function confirmation() {
    var answer = confirm("dialog test!")
}
//-->
</script>
</head>
<body>
<form>
<input type="button" onclick="confirmation()" value="Test the button">
</form>
</body>
</html>

8 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 17 Apr 2013, 10:39 AM
Hi Mark,

Thank you for reporting the issue. I was able to reproduce it and confirm it as a bug. You can track its progress here: Public URL. It turned out that the issue is not only related to Confirm dialogs, but it is also related to all Firefox specific dialogs like Alert, Confirm, Prompt and etc. 

I have also updated your Telerik points accordingly.

In the meantime, as workaround you can handle the dialog by pressing the OK button with a coded step. Here's the code: 
Manager.Desktop.KeyBoard.KeyPress(Keys.Enter);

Note that you need to add an assembly reference to System.Windows.Forms.dll and a using statement for the System.Windows.Forms namespace.

You can also set the RunsAgainst property for the coded step to FirefoxOnly in order to execute that step only when running the test in Firefox. 

See this video for more information. 

Regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Mark
Top achievements
Rank 1
answered on 17 Apr 2013, 06:36 PM
Thanks for the response, Plamen.

I figured this issue would be related to all of the other dialogs but only ran through the specific use case in the test.

 I ran through you suggested fix and have it working now with FF20.01. I just want to be clear on how this fix should work. Due to the nature of the FF dialog box, this fix will only work against that browser, correct? In relation to the RunAgainst feature and setting it to FF, for the other browsers, I will then have to make a copy of the "handle confirm dialog" step for both IE and Chrome and set it accordingly as well? It would be nice to have a feature that allows for selecting the browsers that you want to run against for a specific step. :)

THanks again for the help on this one!
-Mark

0
Mark
Top achievements
Rank 1
answered on 17 Apr 2013, 08:22 PM
I had some time to test out the runsAgainst feature and am noticing an issue related to chrome only also running against IE. Strange as this seems, I like that it runs against Chrome(v.26) and IE10 but not FF, but this is not the intended functionality of this feature.
I've so far run into this issue on a "click button" step and "handle confirm" step, but not on a "Navigate to" step.
0
Plamen
Telerik team
answered on 18 Apr 2013, 10:42 AM
Hello Mark,

We already have an existing feature request for the RunsAgainst step property to allow you to select multiple browsers. You can track its progress here: Public URL. Regarding the issue with the ChromeOnly selection, I'm not able to reproduce it. If I set a step to run only in Chrome, it doesn't run in IE10. Could you please record a Jing video demonstrating the issue, so we can better understand what exactly is happening?

Kind regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Mark
Top achievements
Rank 1
answered on 18 Apr 2013, 04:20 PM
Hi Plamen,

Thanks for the pointer to the feature request. I'll keep an eye on that one.

That's interesting that you are not seeing the issue.Here is a screencast link and the log for the file. Note that is states the two handle confirm dialogs are not run, but in fact are....

http://screencast.com/t/T3bSsVBq2N2

Overall Result: Pass
------------------------------------------------------------
'4/18/2013 9:15:05 AM' - Using .Net Runtime version: '4.0.30319.296' for test execution. Build version is '2012.2.1527.0'.
'4/18/2013 9:15:05 AM' - Starting execution....
'4/18/2013 9:15:07 AM' - Detected custom code in test. Locating test assembly: Regression.dll.
'4/18/2013 9:15:07 AM' - Assembly Found: C:\Users\mark.torres\Documents\Test Studio Projects\FB_Regression\bin\Regression.dll
'4/18/2013 9:15:07 AM' - Loading code class: 'Regression.FFDialogTest'.
------------------------------------------------------------
------------------------------------------------------------
'4/18/2013 9:15:07 AM' - Using 'InternetExplorer' version '10.0' as default browser. 
'4/18/2013 9:15:07 AM' - 'Pass' : 1. Navigate to : 'C:\temp\testdialog.html'
'4/18/2013 9:15:09 AM' - 'Pass' : 2. Click 'Button'
'4/18/2013 9:15:09 AM' - Current step 'Handle 'Confirm' dialog.' runs against: 'ChromeOnly'. Active browser types 'InternetExplorer'. Skipping step.
'4/18/2013 9:15:09 AM' - 'NotRun' : 3. Handle 'Confirm' dialog.
'4/18/2013 9:15:09 AM' - Current step '[FFDialogTest_CodedStep] : Click okay' runs against: 'FirefoxOnly'. Active browser types 'InternetExplorer'. Skipping step.
'4/18/2013 9:15:09 AM' - 'NotRun' : 4. [FFDialogTest_CodedStep] : Click okay
'4/18/2013 9:15:11 AM' - 'Pass' : 5. Click 'Button'
'4/18/2013 9:15:11 AM' - Current step 'Handle 'Confirm' dialog.' runs against: 'ChromeOnly'. Active browser types 'InternetExplorer'. Skipping step.
'4/18/2013 9:15:11 AM' - 'NotRun' : 6. Handle 'Confirm' dialog.
'4/18/2013 9:15:11 AM' - Current step '[FFDialogTest_CodedStep_Cancel] : New Coded Step' runs against: 'FirefoxOnly'. Active browser types 'InternetExplorer'. Skipping step.
'4/18/2013 9:15:11 AM' - 'NotRun' : 7. [FFDialogTest_CodedStep_Cancel] : New Coded Step
'4/18/2013 9:15:12 AM' - 'Pass' : 8. Keyboard (KeyPress) - Escape (1 times) on 'Button'
------------------------------------------------------------
'4/18/2013 9:15:12 AM' - Overall Result: Pass
'4/18/2013 9:15:12 AM' - Duration: [0 min: 4 sec: 577 msec]
------------------------------------------------------------
'4/18/2013 9:15:12 AM' - Test completed!
0
Plamen
Telerik team
answered on 19 Apr 2013, 01:03 PM
Hello Mark,

Thank you for providing the video. I was able to reproduce the problem and filed a bug on this here: Public URL.

I have also updated your Telerik points for discovering the issue.

Until we fix the bug with new version of Firefox, you can set the SimulateRealClick property for all Click steps that trigger dialogs to True and use the coded step I provided to handle them in all browsers. See this video demonstrating the workaround.

Kind regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Jost von
Top achievements
Rank 1
answered on 06 Nov 2013, 03:39 PM
Hi Palmen,

please can you tell me if this bug is fixed in the meantime?

Today I ran into this error.
My Test Studio is 2013.1.1002.0; FF is 23.0
I tried your publshed link http://www.tizag.com/javascriptT/javascriptconfirm.php and there the problem occurs with Confirm dialog.

Kind Regards
Jost
0
Ivaylo
Telerik team
answered on 11 Nov 2013, 11:09 AM
Hello Jost,

I am sorry you are running into this issue, I have logged a bug on your behalf which you can track using this Public URL.
As a workaround the usage of coded step hitting Enter instead of using the dialog handlers still applies.

I have updated your telerik points accordingly.

Thank you for your understanding.

Regards,
Ivaylo
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Mark
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Mark
Top achievements
Rank 1
Jost von
Top achievements
Rank 1
Ivaylo
Telerik team
Share this question
or