This question is locked. New answers and comments are not allowed.
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
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