无法找到对象类型标签 [英] Trouble locating the object type label

查看:106
本文介绍了无法找到对象类型标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

想象一下,你有两个文本框,一个标签和一个按钮。
当我点击按钮时,会产生一个总和(文本框1的值+文本框2的值),结果显示在标签上(label = 3)。 / span> 当我记录测试并实现播放然后它可以正常工作,但是当我使用大量数据自动化时(例如来自txt文件),编码的UI测试找不到对象标签。
我看到他试图通过Name属性找到这个对象(标签)到记录的计算结果的值(Name = 3),他试图通过属性名称= name来查找由设计师提供对象的标签。


MarceloNéias

Imagine you have two text boxes, a label and a button.
When I click the button is made a sum (value of textbox 1 + value of textbox 2) and the result is displayed on the label (label = 3).
When I record the test and realize playing then it works, but when I automate with a load of data (from a txt file for example), the coded UI test does not find the object label.
I saw that he tries to find this object (label) through the Name property to the value of calculation result recorded (Name = 3), he tries to find by property name = name of the label that gave the object by the designer.


Marcelo Néias

推荐答案

好的我得到你的场景。由于标签的名称与数据相关联,因此它会发生变化,因此测试失败。你可以删除使用Name作为标签的searchCriteria,只需使用controltype。这应该工作,因为页面中只有一个Label。或者,如果您可以在标签上添加ID,也可以将其用于搜索。

Ok i get your scenario. Since the name of the label is tied to the data and it changes hence tests fail. Can you remove the searchCriteria of using Name for the label and just use the controltype. This should work as there is only 1 Label in the page. Alternatively if you can add a ID to the label you can use that for search as well.

谢谢

RItuparna

RItuparna


这篇关于无法找到对象类型标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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