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

IE10 browser.Close()

1 Answer 97 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Veteran
Iron
Andrew asked on 15 Jul 2013, 03:02 PM
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?











1 Answer, 1 is accepted

Sort by
0
Mario
Telerik team
answered on 18 Jul 2013, 03:24 PM
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
Tags
General Discussions
Asked by
Andrew
Top achievements
Rank 1
Veteran
Iron
Answers by
Mario
Telerik team
Share this question
or