IE10 browser.Close()

2 posts, 0 answers
  1. Andrew
    Andrew avatar
    125 posts
    Member since:
    Sep 2008

    Posted 15 Jul 2013 Link to this post

    I am trying through code to close my browser (ie10) but it just wont work.

    int count1 = manager.Browsers.Count;
     
    browser.Close();
     
    int count2 = manager.Browsers.Count;
     
    //Shut-down the manager and do all clean-up
    manager.Dispose();

    when this code runs count1 contains a count of 1, I then call close on the browser, count2 then contains a count 0, then I call dispose.
    but the browser window never closes.

    any idea?











  2. Mario
    Admin
    Mario avatar
    8 posts

    Posted 18 Jul 2013 Link to this post

    Hello Andrew,

    Thank you for contacting Telerik Support.

    I could not find any issue with closing an IE10 browser using version 2012.2.1420 of the framework, below is a full code sample which worked for me:

    Settings settings = new Settings();
    Manager manager = new Manager(settings);
    manager.Start();
    manager.LaunchNewBrowser();
    Browser ie1 = manager.ActiveBrowser;
    int c1 = manager.Browsers.Count;
    Log.WriteLine(c1.ToString());
    manager.ActiveBrowser.NavigateTo("http://www.google.com");
    ie1.Close();
    int c2 = manager.Browsers.Count;
    Log.WriteLine(c2.ToString());
    System.Threading.Thread.Sleep(1000);
    manager.Dispose();

    Let me know if it helps.

    Regards,
    Mario
    Telerik
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top