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

Chrome unable to Handle 'Alert' Dialog

16 Answers 76 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 15 May 2017, 08:36 PM
I am doing a simple handle of a alert dialog after a save button is being pressed and the alert is being handled correctly in IE and Firefox but when I run the same test in Chrome the OK is never clicked and the handle is never resolved.  I am also unable to record anything in Chrome due to the recorder to not start so the test was recorded in Firefox but I think it is probably different issue. 

16 Answers, 1 is accepted

Sort by
0
Nikolay Petrov
Telerik team
answered on 17 May 2017, 12:43 PM
Hi Andrew,

Please provide further details on this case:

 - Which version of the Chrome and Telerik browser extensions do you work with?
 - Provide a scrrenshot of the handle step options, please. 

I attached a possible options configuration on the handle alert dialog step that works fine with Chrome on our side. Try to implement them to check if it works in your case as well.

Best Regards,
Nikolay Petrov
Telerik by Progress
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Andrew
Top achievements
Rank 1
answered on 17 May 2017, 05:41 PM

I did a new install of chrome yesterday it is Version 58.0.3029.110 (64-bit)

test studio is version 2017.1.207.0

and I attached the handle step options

I re downloaded the extensions this morning but they are

Telerik test studio chrome explore 2014.1.410.2

Telerik test studio chrome playback 2016.3.1027.1

Telerik test studio chrome recorder 2014.2.618.5

0
Andrew
Top achievements
Rank 1
answered on 17 May 2017, 05:42 PM
forgot the screenshot in last reply here it is
0
Andrew
Top achievements
Rank 1
answered on 17 May 2017, 05:44 PM
the site is not letting me post my files but I have it set up the same way you do and its not working
0
Nikolay Petrov
Telerik team
answered on 19 May 2017, 12:54 PM
Hi Andrew,

Thank you for the additional information provided.

The problem here seems to be in very old Chrome Recording extension. If update to the latest internal build version (2017.1.328) as pointed out on the attached screenshot it should update the extensions as well.

I hope this would solve the problem.

Kind Regards,
Nikolay Petrov
Telerik by Progress
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Andrew
Top achievements
Rank 1
answered on 25 May 2017, 06:00 PM
I did the upgrade but Chrome is still not handling the alert boxes
0
Nikolay Petrov
Telerik team
answered on 30 May 2017, 11:20 AM
Hello Andrew,

We have a new product release available. It should update the Chrome extensions automatically. Try to update or install fresh and let us know if this solves the problem, please.

Best Regards,
Nikolay Petrov
Progress Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
André
Top achievements
Rank 1
answered on 31 May 2017, 12:19 PM
Same problem. No real solution?
0
Andrew
Top achievements
Rank 1
answered on 31 May 2017, 09:07 PM
it looks like it is working now but I need to re-record some of my tests in Chrome in order to get them to work.
0
Nikolay Petrov
Telerik team
answered on 05 Jun 2017, 07:01 AM
Hi Andrew,

Please make sure that you use latest product release 2017.2.530 with the latest extensions available for Chrome. See the attached screenshot.

Kind Regards,
Nikolay Petrov
Progress Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Austin
Top achievements
Rank 1
answered on 26 Oct 2018, 11:43 AM

I need coded step for handling alert box.

Following code doesn't work for me-

AlertDialog altDlg = new AlertDialog(ActiveBrowser,DialogButton.OK);
Manager.DialogMonitor.AddDialog(altDlg);

I need code only, as its a lot of if-else condition there, so In build dialog handler will now work.

 

0
Elena
Telerik team
answered on 31 Oct 2018, 12:07 PM
Hi Austin,

The dialog from the screenshot looks like a Confirm dialog and probably this is the reason for the failures you encountered when using Alert dialog handler. This said, can you try the following code as it should be the same as yours, but using a Confirm dialog:

// Add a confirm dialog to monitor
ConfirmDialog altDlg = new ConfirmDialog(ActiveBrowser , DialogButton.OK);
Manager.DialogMonitor.AddDialog(altDlg);
 
// Given that there were not dialog attribute set, the manager will not start the monitoring.
// You need to invoke the monitoring
Manager.DialogMonitor.Start();
 
// Then invoke the action that triggers the dialog

Additionally, please note that, you need to explicitly start the dialogMonitor and trigger the dialog appearance after the dialog is added. In other words - the consequence of the actions in the code above need to be explicitly followed. 

I hope this works for you. In case you need further assistance, please let me know. 

Regards,
Elena Tsvetkova
Progress Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Austin
Top achievements
Rank 1
answered on 03 Dec 2018, 02:34 PM

With this code I am facing issue:

1.  The type or namespace name 'ConfirmDialog' could not be found (are you missing a using directive or an assembly reference?)

2. The name 'DialogButton' does not exist in the current context

0
Elena
Telerik team
answered on 06 Dec 2018, 11:53 AM
Hello Austin,

Can you please double check if you have included the following using statement at the beginning of the coded step:

using ArtOfTest.WebAii.Win32.Dialogs;

If not, please add this and then compile the project again. Will this work this time? 

In the case you still face any troubles, please prepare a sample test with this code, which reproduces the issue and send it zipped via this thread. Thanks in advance. 

Regards,
Elena Tsvetkova
Progress Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Ray
Top achievements
Rank 1
answered on 31 Jan 2020, 06:02 PM

Elena -

I bumped into this issue when I had a fairly complicated bit of code (looking through table cells for one particular link) where my code clicked on something that gave me a confirmation dialog. The fact that I could right click on a 'Handle Dialog' step and the "Edit in Code" option was just greyed out and not available seemed non-optimal.

Thinking more about it, I think it would be better to have the 'Edit in Code' option lay down two methods, a setup method and a handle method. The step would have to be split as well.

You could add a comment, in the setup method,which explains that this step would have to be moved so that the step occurs before the step that causes the dialog to appear.

Alternatively, you could add only a handle method and add commented code for the setup method and explain that the commented code needs to be put somewhere to execute at the right time.

At the very least, add the handler method and include a link to documentation which describes the setup method.

Almost anything, except leaving the "Edit in Code" option silently unavailable, would be better.

0
Elena
Telerik team
answered on 05 Feb 2020, 12:52 PM

Hello Ray,

I really appreciate your valuable feedback. I completely agree that we can improve this part of the available options and your idea will be shared with the engineering team. As this doesn't seem to be a difficult task to accomplish, I hope it will be available really soon within Test Studio. 

Thanks once again for your cooperation.

Regards,
Elena
Progress Telerik

 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Andrew
Top achievements
Rank 1
Answers by
Nikolay Petrov
Telerik team
Andrew
Top achievements
Rank 1
André
Top achievements
Rank 1
Austin
Top achievements
Rank 1
Elena
Telerik team
Ray
Top achievements
Rank 1
Share this question
or