如何选择新的鼠标单击位置 [英] How to select new Mouse Click Location

查看:115
本文介绍了如何选择新的鼠标单击位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了VSTS 2010 Beta 1并录制了CodedUITests。
如果有人可以帮我理解如何更改录制的代码,以便在录制时我从列表/表中选择了ItemA然后如何选择ItemX

例如,在完成搜索后,其中一个窗格显示项目如

第1项第2项第2项




项目X

在录制时我使用了产生代码的Item1,如----
mEXCAA_Pane.FilterProperties.Add(" InnerText",ParentEquipmet," Title",""," Class",""," ControlDefinition"," id = AssetsListTree_1 FileCode =""" MEXC-AA"""""""""""""""" """" mEXCAA_Pane1 As HtmlSpan = New HtmlSpan(mEXCAA_Pane)
mEXCAA_Pane1.SearchProperties.Add(" Id",""," Name","")
mEXCAA_Pane1.F ilterProperties.Add("InnerText","ParentEquipmet","Title",""","Class","","ControlDefinition","igtxt =" ,"TagInstance","1","RelativePosition","{X = 690,Y = 208}")鼠标。点击(mEXCAA_Pane1,New Point(28,8))


如何更改此代码,以便能够选择我想要的任何物品?

感谢您的帮助。


++ SG ++

Hi,
I have installed VSTS 2010 Beta 1 and recording CodedUITests.
If someone can help me understand how I can change the recorded code so that if while recording I selected ItemA from a list/table then how can I select ItemX

For example
after completing a search one of the pane displayes items like

Item1
Item2
Item3
.
.
.
.
ItemX

While recording I used Item1 which produced the code like----

mEXCAA_Pane.FilterProperties.Add("InnerText", ParentEquipmet, "Title", "", "Class", "", "ControlDefinition", "id=AssetsListTree_1  FileCode=""MEXC-AA"" ", "TagInstance", "13", "RelativePosition", "{X=642,Y=202}")
Dim mEXCAA_Pane1 As HtmlSpan = New HtmlSpan(mEXCAA_Pane)
mEXCAA_Pane1.SearchProperties.Add("Id", "", "Name", "")
mEXCAA_Pane1.FilterProperties.Add("InnerText", ParentEquipmet, "Title", "", "Class", "", "ControlDefinition", "igtxt=""1""", "TagInstance", "1", "RelativePosition", "{X=690,Y=208}")
Mouse.Click(mEXCAA_Pane1, New Point(28, 8))


How do I now alter this code to be able to select whichever ItemX I want?

Thanks
for your help.


++SG++

推荐答案

您好我建议您在表格中添加ID / NAME等属性使自动化稳定。要点击ItemX我会说

1)从CodedUITest将crossHair拖到ItemX上,然后查看它生成的属性并将其保存到UIMap。现在您可以使用ItemX的UIMap实例单击左键2)重新录制并单击ItemX
3)修改TagInstance并为ITemX提供适当的值。您可以通过在控件上拖动CUIT CrossHair来查看此值

感谢了Rituparna

Hi
First i would recommend you to add properties like ID/NAME to your Table to make the Automation Stable.  To click on the ItemX i would say

1)  From CodedUITest drag the crossHair onto the ItemX and then see the properties it generates and save it to the UIMap. Now you can use the UIMap instance of ItemX to click
2)  Re-Record and Click on ItemX
3)  Modify the TagInstance and give the appropriate value for ITemX. you can see this value by dragging CUIT CrossHair on the control

thanks
Rituparna
 


这篇关于如何选择新的鼠标单击位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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