当窗口中的组合框展开时,回放无法找到子窗口 [英] Play back not able to find Child Window when Combo box with in the window is expanded

查看:66
本文介绍了当窗口中的组合框展开时,回放无法找到子窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI,

点击按钮时,我弹出一个子窗口,里面有一个组合框。我使用下面的代码来选择组合框中的特定项目。下面的代码在

When clicking on a button , i have a child window that pops up which has a Combo box in it. I am using below code to select a particular item in the combo box. Below code fails at

con.Find()失败,说它无法找到子窗口。

con.Find() saying it couldnt find the child window.

当我展开组合框时,它覆盖了窗口的标题,因此我认为它无法找到它。

When i expand the Combo box, it is covering the window's title and hence i think it is not able to find it.

以下代码找不到列表项而不先扩展它。

And below code doesnt find the list item without expanding it first.

Has有谁遇到过同样的情况?有人可以帮忙吗?

Has anyone faced the same situation? Can some one please help?

 


SilverlightListItem listItem = new SilverlightListItem(ComboBox);
           SilverlightText con = new SilverlightText(listItem);
           con.SearchProperties.Add(UITestControl.PropertyNames.Name, ValueToSelect);

               ComboBox.Expanded = true;
               con.Find();
               con.DrawHighlight();
               Mouse.Click(con.GetParent());

推荐答案

已离线解决此问题。列表项没有唯一属性。因此,搜索结束于第一项。解决方法是遍历所有列表项并在其中搜索文本控件(带有"Name"属性)。一旦你获得了列表项索引的
,在Instance属性条件设置为索引的情况下进行另一次搜索,并继续在其中进行搜索。

Resolved this offline. The list items do not have unique properties. Hence, the search was ending up at the first item. The workaround was to iterate through all the list items and search for text control (with "Name" property) inside it. Once you get hold of the list item index, do another search with the Instance property condition set to the index and continue the search inside it.

谢谢,

~Tapas


这篇关于当窗口中的组合框展开时,回放无法找到子窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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