It is very small action but if you are new with CodedUI and struggling to take off (Opening and Closing the browser) with CodedUI then this post could help you…

To start browser and your application you can use below line of code-

BrowserWindow browser = BrowserWindow.Launch(new System.Uri(“”));

Above code will start you browser.

browser.close(); //it will close your browser.

If you have switched to new window and now if you wanted to close only that window then use below code sample-

BrowserWindow newwindow = new BrowserWindow();
newwindow.SearchProperties.Add(“Title”, “Google”);


Hope it will help…


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s