how to identity if button submit has opened a new browser window or new tab in watin
I have the same problem, my site opens a new tab whenever I click on the submit form button. Is there any way to check whether i have opened a new tab or new windows in watin
I have tried myself with ie.internetexplorers to get the new url, it worked in some cases but in most cases it failed.
开发者_开发技巧does any one have any better idea
Browser.AttachTo()
should find you the new window:
string expectedUrl = "http://mysite.com/expected-url/";
using (var newWindow = Browser.AttachTo<IE>(
Find.ByTitle("Expected title")))
{
Assert.AreEqual(expectedUrl, newWindow.Url);
}
精彩评论