开发者

Can't get Coded UI test runs to work with multiple tabs in IE 9

开发者 https://www.devze.com 2023-03-29 07:44 出处:网络
I\'ve been using Coded UI-Tests to test my company\'s web pages and I\'ve run into this problem several times lately, unable to figure out a solution. What I\'m trying to do is have a coded UI test cl

I've been using Coded UI-Tests to test my company's web pages and I've run into this problem several times lately, unable to figure out a solution. What I'm trying to do is have a coded UI test click a link on one of the sites pages, which then opens up the link in a new tab. My issue is asserting that the new page is the right page, and has the right content in it.

When I run the test it will do everything else fine, it opens the link in a new tab, but the test can't seem to see whats on the new tab. I recorded the tests in the IE 9 environment, and set the assertions through the Coded UI interface. Is anyone aware of a way to redirect the tests attention to the new tab? Or what the issue I'm experiencing could be?

Any help开发者_如何学编程 is greatly appreciated, Thanks.


Try finding HtmlDocument with parent set to your window: with several tabs you should find several ones (using FindMatchingControls method).

Then you'll be able to see their captions and figure out how to find the tab you need.

After you find the tab, create HtmlControls with parent set to the HtmlDocument you find.

Please let me know if it doesn't work.

0

精彩评论

暂无评论...
验证码 换一张
取 消