Refresh Browser Count

4 posts, 0 answers
  1. Tony
    Tony avatar
    5 posts
    Member since:
    Dec 2010

    Posted 16 Dec 2010 Link to this post

    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.
  2. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 21 Dec 2010 Link to this post

    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
  3. Andrew
    Andrew avatar
    127 posts
    Member since:
    Sep 2008

    Posted 05 Jan 2011 Link to this post

    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

  4. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 11 Jan 2011 Link to this post

    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
Back to Top