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

Handling multiple scenarios in response to a user action

3 Answers 63 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Shashi
Top achievements
Rank 1
Shashi asked on 26 Jul 2011, 04:50 PM
Hello,

We have a scenario where a single user action will result in one of multiple possible behaviors:

When a user clicks Login button on the login dialog, one of several dialogs can be displayed.  In the most common scenario, a Disclaimer dialog is displayed.  However, other dialogs (such as password expiration and Change Password dialogs) can also be displayed.  Responding to the other dialogs ultimately results in the Disclaimer dialog to be displayed. 

We don't know in advance which dialog will appear - so I cannot have a Wait for Exists on any of the dialogs (because it would fail if one of the other dialogs shows up). 

I have currently implemented the following:

a) User clicks Login button
b) Delay execution for x seconds (to wait for one of the dialogs to be displayed)
c) If Disclaimer dialog is not displayed, check if any of the other dialogs is displayed - handle it if it is (this includes waiting for and handling any other dialogs being displayed before the Disclaimer dialog is displayed). 
d) Wait for Disclaimer dialog and handle it when it is displayed.

Problem is that the test sometimes fails at step c) - because one of the other dialogs sometimes takes a bit longer than expected to show up.   

I know one solution is to increase the timeout for step b) to the max value for all the dialogs - however, this slows down the test in all scenarios.  Also, the required delay is different depending on when the test is run - it is slightly longer when the test is run immediately after deployment as opposed to later.  Besides, the login test is called by other tests in the suite as well - which thus are all slowed down as well.

Does anyone know of a better way to write this test without sacrificing performance?

Thanks,
Shashi

3 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 28 Jul 2011, 05:54 PM
Hello Shashi,

This sounds like a good use of our While loop feature. The idea is to create test steps like this:

While (Disclaimer dialog is not displayed)
    If Password Expired dialog displayed
        Handle Password Expired dialog
    if Change Password dialog displayed
        Handle Change Password dialog
    if (any other possible dialogs)
        Handle dialog
End While

Put short timeouts on each step and the test will run with minimal delay.

Best wishes,
Cody
the Telerik team
Check out the Test Studio roadmap to find out more about the new performance testing functionality coming in our R2 2011 release this September!

Have you looked at the new Online User Guide for Telerik Test Studio?
0
Shashi
Top achievements
Rank 1
answered on 29 Jul 2011, 05:03 PM
Hi Cody,

I am testing your solution - it might work.  However, I have one scenario where the Disclaimer dialog is never displayed.  This results in an infinite loop.  Is there a way to force the test to "break" out of the while loop?

Shashi
0
Cody
Telerik team
answered on 03 Aug 2011, 12:04 AM
Hi Shashi,

No there is no way to force it to break out of the loop. I am thinking we can still take the same approach but modify it just a little. Is there some test that will always appear, eventually, some sort of main header or main menu or something? We can modify the loop to be like this:

While (main screen/menu/text is not displayed)
    If Disclaimer dialog displayed
        Handle Disclaimer dialog
    If Password Expired dialog displayed
        Handle Password Expired dialog
    if Change Password dialog displayed
        Handle Change Password dialog
    if (any other possible dialogs)
        Handle dialog
End While

Kind regards,
Cody
the Telerik team
Check out the Test Studio roadmap to find out more about the new performance testing functionality coming in our R2 2011 release this September!

Have you looked at the new Online User Guide for Telerik Test Studio?
Tags
General Discussions
Asked by
Shashi
Top achievements
Rank 1
Answers by
Cody
Telerik team
Shashi
Top achievements
Rank 1
Share this question
or