简体   繁体   中英

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

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM