如何处理2个同名标题的窗口? [英] How to handle with 2 windows with same title?

查看:103
本文介绍了如何处理2个同名标题的窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


 


我在2个相同的标题窗口上遇到了测试问题。详细地,我单击窗口1上的按钮,然后打开窗口2。请注意,2个窗口具有相同的标题。


如何在两个窗口上处理控件?


请帮忙!


Nga


 


 

解决方案

< blockquote>

您可以使用WinWindow.PropertyNames.OrderOfInvocation作为搜索属性来表示编码UI测试与之交互的实例。


例如:如果您有第一个窗口,其中包含以下内容搜索属性:


this.SearchProperties [WinWindow.PropertyNames.Name] =" Untitled - Notepad";
$
this.SearchProperties [WinWindow.PropertyNames.ClassName] =" Notepad";


您可以使用以下搜索属性创建与第一个窗口具有相同标题的第二个窗口:


this。 SearchProperties [WinWindow.PropertyNames.Name] =" Untitled - Notepad" ;;
$
this.SearchProperties [WinWindow.PropertyNames.ClassName] =" Notepad"; $
this。 FilterProperties [WinWindow.Propert yNames.OrderOfInvocation] =" 2";


谢谢,


Neeraja 


Hi All,

 

I got an issue of testing on 2 same title windows. In detail, I click a button on window 1, then a window 2 is opened. Please note that 2 windows have same title.

How can i handle controls on both windows?

Please help!

Nga

 

 

解决方案

You can use WinWindow.PropertyNames.OrderOfInvocation as the search property to denote the instance that Coded UI Test interacts with.

For ex: if you have the first window with following search properties:

this.SearchProperties[WinWindow.PropertyNames.Name] = "Untitled - Notepad";
this.SearchProperties[WinWindow.PropertyNames.ClassName] = "Notepad";

You can create the second window which has the same title as the first with the following search properties:

this.SearchProperties[WinWindow.PropertyNames.Name] = "Untitled - Notepad";
this.SearchProperties[WinWindow.PropertyNames.ClassName] = "Notepad";
this.FilterProperties[WinWindow.PropertyNames.OrderOfInvocation] = "2";

Thanks,

Neeraja 


这篇关于如何处理2个同名标题的窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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