2017-02-27 63 views
0

AUT的主页显示登录用户的名称。 在刺探使用UFT对象,它显示了以下性质:当脚本在维护模式下运行时,而不是在正常运行模式下执行脚本时识别对象

"Class Name:=WebElement", 
"abs_x:=718", 
"abs_y:=127", 
"class:=<class>", 
"height:=27", 
"html id:=", 
"html tag:=DIV", 
"innerhtml:=firstname lastname", 
"innertext:=firstname lastname", 
"outerhtml:=<div class=""<value>"" ng-bind=""lc\.userName"">firstname lastname</div>", 
"outertext:=firstname lastname", 
"role:=", 
"title:=", 
"type:=", 
"visible:=True", 
"width:=164", 
"x:=718", 
"xpath:=//DIV\[@id=""<value>""\]/DIV\[1\]/DIV\[2\]", 
"y:=76" 

脚本使用类属性,以确定该对象

Set WBLogin=Browser("Browser").Page("Page").WebElement("class:=value") 

当脚本在维护运行模式中执行,UFT能够使用上面的语句来识别对象。
然而,当脚本在正常运行模式下执行,UFT无法识别的对象作为变量WBLogin值为空

+0

你能发布相关的HTML源代码吗? – ManishChristian

+0

班级的实际价值是多少? 请检查它是否有像'。'这样的正则表达式运算符。要么 '*'。这会在执行时造成干扰。 –

回答

0

也许你应该尝试阅读类webelement &尝试的所有子对象,以确定如果你能找到具有类属性“值”的对象。

相关问题