Telerik WebAii Framework-如何将焦点更改为新打开的页面/窗口 [英] Telerik WebAii Framework - How to change focus to newy opened page/window

查看:64
本文介绍了Telerik WebAii Framework-如何将焦点更改为新打开的页面/窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用WebAii Framewok进行测试-我目前处于无法确定我的代码专注于哪个窗口的位置.该代码打开了一个页面,免得说A,单击链接,然后打开一个新的子窗口,将其称为B.如何访问页面/窗口B?如何单击B页上的链接?

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?

非常感谢您的帮助.

谢谢,点网新手

推荐答案

您可以通过调用Manager.WaitForNewBrowserConnect(),然后再调用Manager.ActiveBrowser.WaitUntilReady()来连接到新窗口.第一种方法采用三个参数:用于与新窗口连接的URL的字符串,是否使用部分URL匹配的布尔设置以及超时.

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();

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

后续步骤的工作原理与正常情况相同.

Subsequent steps work just like normal.

这篇关于Telerik WebAii Framework-如何将焦点更改为新打开的页面/窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆