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

被刻印的时光 ゝ 提交于 2019-12-23 22:33:00

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/7098567/cant-get-coded-ui-test-runs-to-work-with-multiple-tabs-in-ie-9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!