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

Refresh Browser Count

3 Answers 67 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tony
Top achievements
Rank 1
Tony asked on 16 Dec 2010, 03:16 PM
Hey guys,

Is there a way to refresh the browser window count (Manager.Browser.Count)?  I've run into a very intermittent problem where occasionally my tests will fail, because the browser count is wrong.  So in my code I want to do a quick check to see if the browser count is where it should be, and if it isn't, refresh the count and try again.

Alternatively, is there a "Wait For" new browser window to load function?  This could also solve the problem, as I think the above maybe related to a timing issue.

Thanks.

3 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 21 Dec 2010, 06:03 PM
Hi Tony,

We have a known bug, #69845, in which the count is not decremented when a popup window is closed. Unfortunately Manager.Browser.Count is a read-only property... you cannot set/change it directly. I do not have an ETA when this bug will be fixed.

There is this function in the Manager class you can try using:

public void WaitForNewBrowserConnect(string url, bool isPartial, int timeout);

Kind regards,
Cody
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
0
Andrew
Top achievements
Rank 1
Veteran
Iron
answered on 05 Jan 2011, 04:34 PM
I am having the same kind of issue, but this did work before.

my script clicks on a link the will lunch a new window to display a pdf file to the user

after that I would do a

manager.Browsers[1].WaitUntilReady();

to wait for the window to finish loading the file

but now I get an index out of range error as the new window is not in the browsers collection yet, it does not seem to be added untill the window has finished loading the pdf file

0
Stoich
Telerik team
answered on 11 Jan 2011, 02:36 PM
Hi Andrew,
    thank you for this feedback.
I've reproduced the problem and I've logged it under:
Bug 104599: Opening a PDF page in a new browser doesn't add the browser to Manager.Browsers collection

You state:
it does not seem to be added untill the window has finished loading the pdf file
However, it seems that it doesn't get added after any period of time which is obviously not a good thing.

I hope we'll be able to provide you with a fix for this in the form of an internal release soon enough.

All the best,
Stoich
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
Tags
General Discussions
Asked by
Tony
Top achievements
Rank 1
Answers by
Cody
Telerik team
Andrew
Top achievements
Rank 1
Veteran
Iron
Stoich
Telerik team
Share this question
or