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

Problems switching between browsers

3 Answers 86 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
S
Top achievements
Rank 1
S asked on 15 Nov 2011, 09:26 PM
I'm running several test that fail intermittently.  When the test fail, they usually fail because they've timed out, these time outs occur even when I can clearly see the element on screen.  What I have noticed is that the issues seem to occur most often when a browser page has just closed - what I believe is happening is that the system is occassionally losing track of which browser page is the active browser.  I've tried correcting the problem by adding execution delays - but even though this frequently works it's not a solution I really want to use.  I've tried to navigate to the page I want to be the active browser, but that causes my system to display a message asking if I really want to navigate from the current page - at which point my script fails. 

Is there a simple way to set one of the open browsers as the activebrowser?

Thanks

3 Answers, 1 is accepted

Sort by
0
Stoich
Telerik team
answered on 17 Nov 2011, 04:19 PM
Hi S,
    I will need additional info on this problem in order to troubleshoot it.
Please check out the following video:
http://tv.telerik.com/watch/automated-testing-tools/test-studio-submitting-support-ticket-for-playback-issues

Regards,
Stoich
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
S
Top achievements
Rank 1
answered on 17 Nov 2011, 07:21 PM
Thanks for your help.  I think I have identified what the issue was.  Originally when I was running these test I was occasionally receiving an error message which indicated that the ActiveBrowser had not been closed.  I added code to close the activebrowser whenever I clicked the {save and close button}, once that code was added I started occasionally timing out.  When I opened up the [Click Save & close] button it turns out the code was different for different steps.  I was adding steps using both the recording method and the element table method and I think depending on which method I used there was different code behind the step (there was an issue a few releases back where the settings didn't apply if you added code through the element table method - that issue was resolved but the test in issue would have been recorded before the fix was released).  Some of the code read element.mouseclick and some read element.click(false).   When I went to fix the problem I added an activebrowser close across the board whenever save & close was clicked, because sometimes the Save & Close was already closing the activebrowser I unwittingly caused other issues. I can't be 100% sure that this was the issue because the problem only occurs occasionally but since the problems was only occurring in test where there was a difference in how the save & close was recorded I am somewhat optimistic.

Thanks
0
Stoich
Telerik team
answered on 22 Nov 2011, 12:42 PM
Hello S,
your description makes sense to me. You should be careful when invoking code to close the browser. My advise is to refrain from doing it without a good reason. This is especially true when using the RecycleBrowser feature which will attempt to use a single browser for all your tests (thus saving time) - see attached screenshot.

Some steps will close the browser with an action. For instance popups are treat by Test Studio as another browser and can be close by a per-recorder action.

Also don't use:
ActiveBrowser.Window.Close();

Use
ActiveBrowser.Close();

Best wishes,
Stoich
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
Tags
General Discussions
Asked by
S
Top achievements
Rank 1
Answers by
Stoich
Telerik team
S
Top achievements
Rank 1
Share this question
or