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

How to handle a Prompt Dialog in Test Studio

6 Answers 187 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Harsha
Top achievements
Rank 1
Harsha asked on 10 Aug 2017, 12:50 PM

Hi team,

The application under test is asking to enter some values in a dialog (Capture 1) and when I recorded, it shows as a Prompt Dialog (Capture 2).

  1. I need to verify whether this dialog exists
  2. Then, I need to enter some value and click on either Ok or Cancel button

I added a step to handle this dialog but when the script is running Test Studio is unable to enter provided value and click on the button. 

This dialog can be dragged over the page.

I've gone through your threads but couldn't find any for handling Prompt dialog.

Could you please provide a sample coded step to handle above two instances for Prompt dialog?

 

Regards,

Harsha

6 Answers, 1 is accepted

Sort by
0
Harsha
Top achievements
Rank 1
answered on 12 Aug 2017, 02:47 PM

Hi team,

Any update on this?

Thanks.

0
Elena
Telerik team
answered on 14 Aug 2017, 02:55 PM
Hello Harsha,

Thank you for sharing details about the faced difficulty. 

Please let me know what is the recorded step when you try to handle that dialog during recording? What is the behavior when executing that recorded step? 

Could you please provide the step failure details for the failing step? 

To address your query for a coded solution how to handle a dialog I would recommend you double check the custom dialog handler described here

Thanks in advance for your time and cooperation. 

Regards,
Elena Tsvetkova
Progress Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Harsha
Top achievements
Rank 1
answered on 14 Aug 2017, 07:49 PM

Hi Elena,

Thank you so much for the reply. I managed to write a coded step to verify the existence of Prompt dialog.

But I'm still facing an issue when running the step for handling the dialog as it shows up the dialog two times when running my script. Initially it enters the value I'm asking and when clicking on the button the dialog shows up again. This does not happen when I do it manually in the application.

Thanks.

0
Elena
Telerik team
answered on 17 Aug 2017, 10:37 AM
Hello Harsha,

Thank you for your cooperation. 

The described behavior does not seem to be caused by Test Studio. Though I would like to place few more questions about that dialog. Please let me know your input on the below queries: 
- is the execution behavior the same against the different browsers? 
- if you do not enter value but cancel the prompt dialog will the behavior change? 
- could you double check if entering the same value in the dialog manually in the application would not trigger the dialog once again?
- would it be possible to provide a sample test containing the handle dialog step for further investigation? if the application under test is public accessible I would be glad to know if I could execute the test on my end. 

I will be I will be looking forward to hearing from you! Thanks in advance! 

Regards,
Elena Tsvetkova
Progress Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Harsha
Top achievements
Rank 1
answered on 03 Oct 2017, 06:56 PM

Hi Elena,

I'm sorry for not getting back to you.
I managed to handle the Prompt dialog and verify the Caption on it.
But now I need to verify that OK and Cancel buttons (as shown in Capture 1) are also displayed in the dialog.
Could you please guide me on this?

Regards,
Harsha

0
Elena
Telerik team
answered on 05 Oct 2017, 11:43 AM
Hi Harsha,

Thank you for getting back. I am glad to know you managed to handle the dialog successfully. 

The text in a dialog box could be verified in a coded solution described here for IE and here for Chrome. Though this approach would not provide verification of the buttons. 

To verify these you would need to get the Handle of the browser when the dialog appears and then implement custom code using the Microsoft UI Automation framework to identify the dialog and verify its buttons. Though you should be informed this is a custom implementation which is out of the Test Studio support team authority. 

I hope the above information will be helpful to you to find the best solution to accomplish your scenario. Thank you for your understanding in advance and do not hesitate to contact me again in case of further queries. 

Regards,
Elena Tsvetkova
Progress Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Harsha
Top achievements
Rank 1
Answers by
Harsha
Top achievements
Rank 1
Elena
Telerik team
Share this question
or