locked
What reference or code or service should I use for the Coded UI to be able to do dialog box monitoring?

    Question

  • Hi,

    I am currently doing a Coded UI test. I've got this scenario where I have to record a log-in event. below is a pseudo code of actions:

    1. Type the URL in the browser

    2. Log-in dialog box was displayed

    3. Enter log-in credentials

    4. Home Page was displayed

    5. Click on Documents Tab - (for example the application contains tabs and Documents tab contains a sharepoint page)

    6. Log-in dialog box was displayed

    7. Enter log-in credentials

    8. List of documents were displayed

    9. Click on a Document Link

    10. Document was opened.

    In this case, if you will re-run the test, the test will 'Pass' in normal condition since Coded UI runs on ordered/ sequential manner. But what if the log-in behaves differently? e.g. log-in was displayed intermitently or appears unexpectedly:

    1. Type the URL in the browser

    2. Log-in dialog box was displayed

    3. Enter log-in credentials

    4. Home Page was displayed

    5. Click on Documents Tab

    6. Log-in dialog box was displayed

    7. Enter log-in credentials

    8. List of documents were displayed

    9. Click on a Document Link

    10. Log-in dialog box was displayed

    11. Enter log-in credentials

    12. Document was opened.

    so, for this scenario, the test will fail since there will be an extra steps.

    Is there a way that the log-in will be monitored so that whenever it will be displayed, a block of code will be called and will execute "Enter log-in credentials".

    Wednesday, April 13, 2011 6:44 AM

All replies

  • Include an IF condition to check whether the login dialog box exists after step 9, If exists the script should test steps 10 ,11, 12, else it should test only step 12.
    Friday, April 15, 2011 4:19 AM