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

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

11 Answers 325 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.
ravi
Top achievements
Rank 1
ravi asked on 10 Sep 2010, 08:49 AM
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

11 Answers, 1 is accepted

Sort by
0
Nikolai
Telerik team
answered on 10 Sep 2010, 09:23 AM
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
0
ravi
Top achievements
Rank 1
answered on 10 Sep 2010, 09:38 AM
Hi Nikolai,

Thanks for the speedy reply,

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

Thanks

Ravi
0
Cody
Telerik team
answered on 13 Sep 2010, 04:03 PM
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
0
Hassan
Top achievements
Rank 1
answered on 06 Jun 2011, 08:02 PM
was this issue resolved as i am facing the same problem ?
i.e. popup window when closing browser.
0
Stoich
Telerik team
answered on 10 Jun 2011, 11:47 AM
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!
0
Hassan
Top achievements
Rank 1
answered on 21 Jun 2011, 03:56 PM
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
0
Anthony
Telerik team
answered on 24 Jun 2011, 05:36 PM
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?
0
Mark
Top achievements
Rank 1
answered on 30 Jun 2011, 03:53 AM
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
0
Anthony
Telerik team
answered on 30 Jun 2011, 03:21 PM
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?
0
Mark
Top achievements
Rank 1
answered on 01 Jul 2011, 02:20 AM
Hi Anthony,

Thanks! But is it alright to install the latest internal build because I'm using a licensed version?
0
Anthony
Telerik team
answered on 01 Jul 2011, 03:34 PM
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?
Tags
General Discussions
Asked by
ravi
Top achievements
Rank 1
Answers by
Nikolai
Telerik team
ravi
Top achievements
Rank 1
Cody
Telerik team
Hassan
Top achievements
Rank 1
Stoich
Telerik team
Anthony
Telerik team
Mark
Top achievements
Rank 1
Share this question
or