Search code examples
htmlhp-uft

Decriptive Programming Multiple properties


I am using to UFT and having a problem in describing multiple properties for an object.

b_username = "html id:=txtUsername","type:=text"

Trying this has not helped me. Even tried the ";" delimiter but that too is not working.


Solution

  • I think you have misunderstood how to reference an object using Descriptive Programming.

    You still use the UFT syntax of Browser().Page().WebEdit() (for example) and because you are trying to set an object reference you need the Set keyword. Try something like:

    Set b_username = Browser("micclass:=Browser").Page("micclass:=Page").WebEdit("html id:=txtUsername","type:=text")
    

    This will allow you to use b_username to reference the text box with the html id of txtUsername:

    b_username.Set myUsernameValue
    

    For a pretty good basic introduction to descriptive programming, check out LearnQTP.com