简体   繁体   中英

is it possible to use variable in Object Declaration in UFT

I have a command link below in UFT/QTP

Set oElement = oDUT.MNativeElement("by:=xpath","identifier:=" & vFinalProperty)

is it possible to assign "oDUT.MNativeElement" to a variable and execute the line.

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. This is no different to defining a Browser object and referring to it later on. If it's Set as an object reference it's fine.

For example:

oElement.Click ' will send a Click event (if available for this object type) to the oDUT.MNativeElement object

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM