Telerik WebAii Framework - How to change focus to newy opened page/window

回眸只為那壹抹淺笑 提交于 2019-12-12 02:53:56

问题


Testing using WebAii Framewok - I am currently stuck at a point where I'm not able to determine which window my code is focused on. The code opens a page lest say A, clicks on a link which then opens a new child window, call it B. How do I access page/window B? How do I click a link on page B?

Your help is much apprciated.

Thanks, dot net newbie


回答1:


You can connect to a new window by using the call Manager.WaitForNewBrowserConnect() followed by Manager.ActiveBrowser.WaitUntilReady(). The first method takes three parameters: a string for the URL to connect to with the new window, a boolean setting whether or not to use partial URL matching, and a timeout.

You'll be connected to the new window. From that point on you continue with your steps as usual.

For example, on a demo app I have I use a coded step with:

Manager.WaitForNewBrowserConnect("http://localhost:3000/contacts/16/edit", true, 5000); Manager.ActiveBrowser.WaitUntilReady();

Subsequent steps work just like normal.



来源:https://stackoverflow.com/questions/7844050/telerik-webaii-framework-how-to-change-focus-to-newy-opened-page-window

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