02-23-2012, 12:24 PM
Using QTP 9.2 Windows 7
Im learning how to create and use functions libraries in QTP.
I have created log in and log out functions for my application
When im calling the function in any other test it generates an error that Login object not found in the object repository.
I know these objects are not present in the OR, how can I used these Functions in my test?
Need guidance for it.
Thanks.
Im learning how to create and use functions libraries in QTP.
I have created log in and log out functions for my application
Code:
Function login()
Browser("Login Form").Page("Login Form").WebList("Login1$Company").Select "095 - TEXPO – 095"
Browser("Login Form").Page("Login Form").WebEdit("Login1$Password").SetSecure "4f45d60061419cac90ecb62f"
Browser("Login Form").Page("Login Form").WebEdit("Login1$UserName").Set "madeeha"
Browser("Login Form").Page("Login Form").Image("Login1$LoginButton").Click 22,13
End Function
Code:
Function logout()
Browser("Softronic - HCMS").Page("Softronic - HCMS_2").Sync
Browser("Softronic - HCMS").Close
Browser("Login Form").Page("Softronic Applications").Link("Logout").Click
Browser("Login Form").Page("Login Form").Sync
Browser("Login Form").Close
End Function
I know these objects are not present in the OR, how can I used these Functions in my test?
Need guidance for it.
Thanks.