http://puu.sh/mVDoM/069787ca8d.png
http://puu.sh/mVDoM/069787ca8d.png
I am using teststack white and I tried using:
我使用teststack白色,我尝试使用:
ListViewRow presetter = p7window.Get<ListViewRow>(SearchCriteria.ByText("Presetter"));
presetter.Click();
TableRow presetter = p7window.Get<TableRow>(SearchCriteria.ByText("Presetter"));
presetter.Click();
ListItem presetter = p7window.Get<ListItem>(SearchCriteria.ByText("Presetter"));
presetter.Click();
I also tried using "Name row 1" and "row 1" for the string that is in the argument.
我还尝试使用“名称行1”和“行1”作为参数中的字符串。
2 个解决方案
#1
0
When you specify and call it to find by text, it is saying the "text" property, not that it might contain text with that value. TableRow doesn't usually have text property, but rather uses things like "Value" "RowIndex" etc.
当您指定并调用它以按文本查找时,它表示“text”属性,而不是它可能包含具有该值的文本。 TableRow通常不具有text属性,而是使用“Value”“RowIndex”等内容。
Also, you should be aware of the place of the element in the tree, you might have to pass it to a parent control.
此外,您应该知道元素在树中的位置,您可能必须将它传递给父控件。
i.e.
即
List list = p7window.Get<List>(SearchCriteria.ByValue("Presetter"));
ListItem li = list.Get<ListItem>(SearchCriteria.ByValue("Presetter"));
#2
0
Try to get AutomationElement for it.
尝试获取AutomationElement。
***.GetElement(SearchCriteria.ByText("Presetter"));
If it's not null find a point by getClicablePoint() and perform click by mouse like Mouse.Instance.Click()
如果它不为null,请通过getClicablePoint()找到一个点,并像Mouse.Instance.Click()一样执行鼠标点击
If the element is not reachable by any SearachCriteria - try to use native MS UI Automation:
如果任何SearachCriteria无法访问该元素 - 请尝试使用本机MS UI自动化:
- Get the closest root control to yours.
- 获得最接近你的root控件。
- Take Autoelement property from it.
- 从中获取Autoelement属性。
- Find whole children list of it like AutomationElement.FindAll(Treescrope.Descendals, PropertyCondition.TrueCondion) _
- 找到它的全部子列表,如AutomationElement.FindAll(Treescrope.Descendals,PropertyCondition.TrueCondion)_
- Find your element in Autoelements Array by any property you need.
- 通过您需要的任何属性在Autoelements Array中找到您的元素。
- Get invoke pattern from it and use Invoke()
- 从中获取调用模式并使用Invoke()
#1
0
When you specify and call it to find by text, it is saying the "text" property, not that it might contain text with that value. TableRow doesn't usually have text property, but rather uses things like "Value" "RowIndex" etc.
当您指定并调用它以按文本查找时,它表示“text”属性,而不是它可能包含具有该值的文本。 TableRow通常不具有text属性,而是使用“Value”“RowIndex”等内容。
Also, you should be aware of the place of the element in the tree, you might have to pass it to a parent control.
此外,您应该知道元素在树中的位置,您可能必须将它传递给父控件。
i.e.
即
List list = p7window.Get<List>(SearchCriteria.ByValue("Presetter"));
ListItem li = list.Get<ListItem>(SearchCriteria.ByValue("Presetter"));
#2
0
Try to get AutomationElement for it.
尝试获取AutomationElement。
***.GetElement(SearchCriteria.ByText("Presetter"));
If it's not null find a point by getClicablePoint() and perform click by mouse like Mouse.Instance.Click()
如果它不为null,请通过getClicablePoint()找到一个点,并像Mouse.Instance.Click()一样执行鼠标点击
If the element is not reachable by any SearachCriteria - try to use native MS UI Automation:
如果任何SearachCriteria无法访问该元素 - 请尝试使用本机MS UI自动化:
- Get the closest root control to yours.
- 获得最接近你的root控件。
- Take Autoelement property from it.
- 从中获取Autoelement属性。
- Find whole children list of it like AutomationElement.FindAll(Treescrope.Descendals, PropertyCondition.TrueCondion) _
- 找到它的全部子列表,如AutomationElement.FindAll(Treescrope.Descendals,PropertyCondition.TrueCondion)_
- Find your element in Autoelements Array by any property you need.
- 通过您需要的任何属性在Autoelements Array中找到您的元素。
- Get invoke pattern from it and use Invoke()
- 从中获取调用模式并使用Invoke()