[英]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. 使用WebAii Framewok进行测试-我目前处于无法确定我的代码专注于哪个窗口的位置。 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?
该代码打开了一个页面,免得说A,单击链接,然后打开一个新的子窗口,称为B。如何访问页面/窗口B? How do I click a link on page B?
如何单击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(). 您可以通过调用Manager.WaitForNewBrowserConnect(),然后再调用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.
第一种方法采用三个参数:用于与新窗口连接的URL的字符串,是否使用部分URL匹配的布尔设置以及超时。
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.WaitForNewBrowserConnect(“ http:// localhost:3000 / contacts / 16 / edit”,true,5000); Manager.ActiveBrowser.WaitUntilReady();
Manager.ActiveBrowser.WaitUntilReady();
Subsequent steps work just like normal. 随后的步骤正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.