Micro Focus QTP (UFT) Forums
Hep to create yahoo log in function. - 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: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Hep to create yahoo log in function. (/Thread-Hep-to-create-yahoo-log-in-function)



Hep to create yahoo log in function. - jinnah1978 - 02-23-2012

Hi! I did descriptive programming to log in, To write and save in yahoo notepad and log out with input and output checkpoints.

Now I want to convert the log in code (Descriptive) as a function. I know how to associate it with the script and call. But I have some problem with converting the Descriptive code as function. here is my code.I am confused what to put in ()
-------------------------------------------------------------
Code:
Function yahooLogIn (ID, password)
ID=jinn***ml
password = "*****4f45aac28**************"

Browser("Micclass:=Browser").Page("Micclass:=page").WebEdit("html id:=username").Set ID
Browser("Micclass:=Browser").Page("Micclass:=page").WebEdit("html id:=passwd").SetSecure password
Browser("Micclass:=Browser").Page("Micclass:=page").WebButton("html id:=.save").Click
End Function



RE: Hep to create yahoo log in function. - inborntester - 02-23-2012

Hope you mention() for functions. what u put in () is correct only. but you should comment below tow lines

Code:
ID=jinn***ml
password = "*****4f45aac28**************"

these are things could vary on function call, passed through parameters ID, password variables.
use below like code to call the function

Code:
yahooLogIn "jinn***ml",  "*****4f45aac28**************"