dailog window is popup while trying to close browser after execute test case

12 posts, 0 answers
  1. ravi
    ravi avatar
    15 posts
    Member since:
    Jul 2010

    Posted 10 Sep 2010 Link to this post

    Hi,

    I have recording scripts on my application. my appliaction popups when application closes with out click on "Logout" button by closing the browser clicking on "X" link.

    My issues is here,  after execute the test script WebUI try to close the browser session, by the time the popup displayed. The WebUI is not able to handel the window and broser doesnot closes.

    Pls advise me how to handle the popup.

    Thanks

    Ravi
  2. Nikolai
    Admin
    Nikolai avatar
    85 posts

    Posted 10 Sep 2010 Link to this post

    Hello ravi,

    Currently there is no way to handle dialogs when the browser closes. We log this as a Feature Request in our system.

    Greetings,
    Nikolai
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. ravi
    ravi avatar
    15 posts
    Member since:
    Jul 2010

    Posted 10 Sep 2010 Link to this post

    Hi Nikolai,

    Thanks for the speedy reply,

    Is it possible to stop closing browser after test execution complete.

    Thanks

    Ravi
  4. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 13 Sep 2010 Link to this post

    Hi ravi,

    Yes there is however we don't recommend using it because it can cause undesired side effects. The first is that the Manager object will hang for 30 seconds watching and waiting for all browser windows to close at the end of the test. It finally gives up and exits.

    You need to add a code behind file to your test and override the CleanUp method in it like this (this is a C# code sample):

    public override void CleanUp()
    {
        if (this.ExecutionContext.TestResult.Result == ArtOfTest.Common.Design.ResultType.Fail)
        {
            // The test has failed. Perform any action needed on failure.
            // Do NOT call base.CleanUp() which forces the browser to stay open.
        }
        else
        {
            // The test passed. Perform any action desired on success.
            base.CleanUp();
        }
    }


    Regards,
    Cody
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Hassan
    Hassan avatar
    2 posts
    Member since:
    Aug 2010

    Posted 06 Jun 2011 Link to this post

    was this issue resolved as i am facing the same problem ?
    i.e. popup window when closing browser.
  6. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 10 Jun 2011 Link to this post

    Hello Hassan,
          currently we're able to handle these "Close browser" dialogs.

    However, you have to set the Click step that brings up the Dialog to be ClosesBrowser=true (see screenshot 1). Otherwise your test will get stuck on the click step.

    On more thing: this Dialog will only appear in IE - other browsers simply don't have this implementation. Because of this you might want to set the Handle 'Generic' Dialog step to RunsAgainst=InternetExplorerOnly (see screenshot 2)

    Greetings,
    Stoich
    the Telerik team
    Do you think you know all the new features coming out in Test Studio R1 2011? Think again - we have some surprises and will share them with you in the What's New in Test Studio R1 2011 Webinar on May 12th.
    Register Today!
  7. Hassan
    Hassan avatar
    2 posts
    Member since:
    Aug 2010

    Posted 21 Jun 2011 Link to this post

    Hi Stoich,

    Thank you for the reply. We applied all these methods but none of them worked in our situation.
    Because it never gets to that handler step(from options you mentioned) since popup box is opened when all steps are finished and test studio tries to close the browser.
    Hassan
  8. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 24 Jun 2011 Link to this post

    Hi Hassan,

    You are correct; your scenario is slightly different and poses an automation challenge. I have reproduced this locally with a Microsoft demo site and will file a bug for it.

    In the meantime you can try a work-around. Insert a "Navigate to" step after the last test step, but before the "Handle OnBeforeUnload dialog" step. It can navigate anywhere, like google.com for instance. This way, the "Are you sure you want to navigate away from this page" alert will be prompted by navigating to another page and not by closing the browser. Test Studio remains engaged for an additional step, properly handles the dialog, and navigates to Google.

    See the attached screen shot for an example of the step order.

    All the best,
    Anthony
    the Telerik team
    Register today for a live 'What's New in Test Studio R1 2011 SP2' event on Tuesday, July 19 at 2pm EST!

    Have you looked at the new Online User Guide for Telerik Test Studio?
  9. Mark
    Mark avatar
    22 posts
    Member since:
    May 2011

    Posted 29 Jun 2011 Link to this post

    Hi Anthony,

    I can't find/add the step "Handle OnBeforeUnload dialog".

    Can we have an option to close the browser before the test ends? So that we can add the step to Handle Dialogs?

    Thanks
  10. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 30 Jun 2011 Link to this post

    Hello Mark,

    I suspect you are on an older version of Test Studio than me. I am on the latest internal build and have the OnBeforeUnload option available in the Dialogs drop-down. See the attached screen shot. Test Studio should insert it automatically while recording, however.

    We are aware that this dialog handler is not behaving exactly as it should and are striving to fix it soon. In the meantime please try one of the work-arounds mentioned in this thread.

    Best wishes,
    Anthony
    the Telerik team
    Register today for a live 'What's New in Test Studio R1 2011 SP2' event on Tuesday, July 19 at 2pm EST!

    Have you looked at the new Online User Guide for Telerik Test Studio?
  11. Mark
    Mark avatar
    22 posts
    Member since:
    May 2011

    Posted 30 Jun 2011 Link to this post

    Hi Anthony,

    Thanks! But is it alright to install the latest internal build because I'm using a licensed version?
  12. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 01 Jul 2011 Link to this post

    Hi Mark,

    Yes, absolutely. Access the "Internal Builds Downloads" link at the lower right of the "Your Account" page.

    Greetings,
    Anthony
    the Telerik team
    Register today for a live 'What's New in Test Studio R1 2011 SP2' event on Tuesday, July 19 at 2pm EST!

    Have you looked at the new Online User Guide for Telerik Test Studio?
Back to Top
  Cast Your Vote at DevPro Connections! Cast Your Vote at  Win IT Pro Connections!