简体   繁体   English

Telerik WebAii Framework-如何将焦点更改为新打开的页面/窗口

[英]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.

相关问题 使用Telerik的WebAii框架测试分页 - Testing paging with Telerik's WebAii framework 如何在Telerik中将焦点转移到父窗口? - How to shift focus to parent window in Telerik? 使用 WinAppDriver,当在 WPF 应用程序中打开新的 window 时,我需要有关如何更改焦点的帮助 - Using WinAppDriver, I need help on how to change focus when a new window is opened in the WPF application 打开新窗口时,如何在主框架中启用焦点 - how to enable focus in the main frame, when a new window was opened 如何使用telerik窗口打开底部带有恒定面板的页面? - How to use the telerik window to open a page with a constant panel at the bottom? 打开窗口时,如何将数据模板化的文本框聚焦在窗口中 I​​temsControl 的第一个元素中? (C#, WPF) - How to focus a datatemplated TextBox in the first element of an ItemsControl in a Window, when the Window is opened? (C#, WPF) 防止窗口焦点变化 - Prevent Window Focus Change C# WPF 如何更改 window 所有打开的标题 Z0F4137ED1502B5045D4083AA258B5C - C# WPF How to change window title of all opened windows C#自动测试-Webaii Silver Light网站radWindow不在重点 - C# Autromated test - Webaii Silver Light Website radWindow Not in focus 如何在紧凑框架中更改主窗口? - How to change the main window in compact framework?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM