0% found this document useful (0 votes)
13 views

How To Pass Objects To Function

The document discusses how to pass objects as parameters to a function in QTP. It provides an example of capturing username and password objects on a login page and passing them, along with the login credentials, to a Login function. The Login function then sets the username and password values on the objects and clicks the login button object to log the user in.

Uploaded by

kotichallenges
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

How To Pass Objects To Function

The document discusses how to pass objects as parameters to a function in QTP. It provides an example of capturing username and password objects on a login page and passing them, along with the login credentials, to a Login function. The Login function then sets the username and password values on the objects and clicks the login button object to log the user in.

Uploaded by

kotichallenges
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

How to pass objects to a function in QTP

I have a function for Login screen which will take the objects as well as data as input parameters.
How can I capture the objects and pass username, password and Login buttons as parameters to
the function.

7/18/10

Jay

Set objUsername = Browser(brName).Page(pgName).WebEdit(userName)


Set objPasswd = Browser(brName).Page(pgName).WebEdit(passwod)

Call Login(objUsername, objPasswd, "newUser", "hello123")

Public Function Login(userNameObject, passwordObject, paraUser, paraPassword)

userNameObject.Set paraUser
passwordObject.Set paraPassword
loginButtonObject.Click

End Function
first  |  < previous  |  next >  |  last
4D077AB1D981A rqYDS5B6EymC7 54939227541377
report spam

You might also like