locked
Handle pop up window if it shows? RRS feed

  • Question

  • Hi i recorded coded ui test for web app but sometime it works like that if somebody log in and wait for a main page could see a pop up window but not always, user number 1 can see that pop up but when will log in user 3 he could not see it. So that i will test my web app on many users(logins) i need do something like this if(pop up windows show U) do something...how can i do that?
    Wednesday, August 8, 2012 11:17 AM

Answers

  • Hi,

    My work with CUIT mostly includes the client side of non-web applications so I was not aware of the solution suggested by Rajendra. But just in case it doesn’t work as you would like it to, I suggest handling the situation differently:

    If you know exactly what popup window you expect:

    1. Create an instance of it including the relevant search properties.
    2. Set the playback settings "SearchTimeOut" property to a reasnebl time for finding that window if it appears (you don’t have to wait a hole two minutes – default timeout, to find out it does not exist).
    3. Ask: if (popupWin.Exists)
    4. Do whatever action you need to do to get rid of the popup window.
    5. After the "if" block, set "SearchTimeOut" back to its original value.

    If you don’t know what the specific popup window might look like:

    1. Ask: if (!lastActiveWindow.Enabled)
    2. Call: Keyboad.SendKeys("{F4}", ModifierKeys.Alt) to close it or Keyboad.SendKeys("{Tab}{Enter}") if it suits you better.
    3. This action will automatically close the popup window and let you get on with your code.

    Hope this will solve your problem.

    Elizur Mach

    ALM team, Sela Group.

    Wednesday, August 8, 2012 9:28 PM
  • You can  handle the pop ups using the below way


    Thanks and Regards -Rajendra



    Wednesday, August 8, 2012 11:27 AM

All replies

  • You can  handle the pop ups using the below way


    Thanks and Regards -Rajendra



    Wednesday, August 8, 2012 11:27 AM
  • Hi,

    My work with CUIT mostly includes the client side of non-web applications so I was not aware of the solution suggested by Rajendra. But just in case it doesn’t work as you would like it to, I suggest handling the situation differently:

    If you know exactly what popup window you expect:

    1. Create an instance of it including the relevant search properties.
    2. Set the playback settings "SearchTimeOut" property to a reasnebl time for finding that window if it appears (you don’t have to wait a hole two minutes – default timeout, to find out it does not exist).
    3. Ask: if (popupWin.Exists)
    4. Do whatever action you need to do to get rid of the popup window.
    5. After the "if" block, set "SearchTimeOut" back to its original value.

    If you don’t know what the specific popup window might look like:

    1. Ask: if (!lastActiveWindow.Enabled)
    2. Call: Keyboad.SendKeys("{F4}", ModifierKeys.Alt) to close it or Keyboad.SendKeys("{Tab}{Enter}") if it suits you better.
    3. This action will automatically close the popup window and let you get on with your code.

    Hope this will solve your problem.

    Elizur Mach

    ALM team, Sela Group.

    Wednesday, August 8, 2012 9:28 PM
  • Hello elizurm,

    Could you please elaborate more on this approach or provide a code sample to help me on this. Looks like i'm looking for something similar.

    Thanks,

    Shraddha

    Wednesday, November 7, 2012 4:39 PM