[英]is it possible to use variable in Object Declaration in UFT
I have a command link below in UFT/QTP
我在UFT/QTP
有一个命令链接
Set oElement = oDUT.MNativeElement("by:=xpath","identifier:=" & vFinalProperty)
is it possible to assign "oDUT.MNativeElement"
to a variable and execute the line. 是否可以将"oDUT.MNativeElement"
分配给变量并执行该行。
Yes you can do this and then (as in your example) you would refer to oElement
in the future when you needed to refer to it. 是的,您可以执行此操作,然后(如您的示例所示)将来在需要引用oElement
时将其引用。 This is no different to defining a Browser
object and referring to it later on. 这与定义Browser
对象并在以后引用它没有什么不同。 If it's Set
as an object reference it's fine. 如果将其Set
为对象引用就可以了。
For example: 例如:
oElement.Click ' will send a Click event (if available for this object type) to the oDUT.MNativeElement object
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.