Micro Focus QTP (UFT) Forums
Dynamic variable in link call - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Dynamic variable in link call (/Thread-Dynamic-variable-in-link-call)



Dynamic variable in link call - rdix007 - 03-28-2013

I want to pass in variable in to link name click call. I am entering below which doesnt work. Can anyone tell me syntax for achieveing intended click:
Code:
Function EnableUser (Firstname, Lastname)

Browser("Client Login").Page("User Management").Link("All Users").Click     
'above works
Browser("Client Login").Page("User Management").Link(Lastname, Firstname).Click     
'above doesn't work

End Function

Many Thanks
-Rahul


RE: Dynamic variable in link call - basanth27 - 03-28-2013

When you spy for a name is that how it looks like? "Lastname, First name"
or Lastname, Firstname?
you probably would need to pass the object property for indentification when you are trying to parameterize your value.
For eg:
Code:
Link("All Users") is a object stored in your Object repository.
Link("name:=Lastname,firstname") is a descriptive object which is created during run time.
name is the property and Lastname, firstname is its value. If you spy and check the object properties you will get a better idea.