Micro Focus QTP (UFT) Forums
Checkpoints with Functions - 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: Checkpoints with Functions (/Thread-Checkpoints-with-Functions)



Checkpoints with Functions - rdwaram - 11-12-2009

I am just getting a hang of using functions and am very successful with the basic stuff.

Checkpoints:
Code example:

a.
Code:
Browser("Login").Page("Login").WebEdit("_email").Set "User@email.com"
Browser("Login").Page("Login").WebEdit("_password").Set "mypassword"
Browser("Login").Page("Login").WebButton("Log In").Click

a. I would be able to click on each line in keyword view and insert a check point.


b.
I am unable to do that within this function.
Public Function Login(ByRef Username, ByRef password)

b.
Code:
Browser("Login").Page("Login").WebEdit("_email").Set username
Browser("Login").Page("Login").WebEdit("_password").Set password
Browser("Login").Page("Login").WebButton("Log In").Click

End Function


How else can i still setup checkpoints. I also tried putting checkpoints within the code of my function. I didn't think that was correct either.

This has be something simple that i am not getting. So any help would be great for me to progress in my process.

Thanks,
rd


RE: Checkpoints with Functions - Jackomcnabb - 11-17-2009

I'm not sure what you want to test.

But you can make your own check points in your function.
Simple example would be:

'Make sure username is not empty
Code:
If Username <> "" then
Reporter.ReportEvent micPass, "Username", "Username was not empty"
Browser("Login").Page("Login").WebEdit("_email").Set username
Else
Reporter.ReportEvent micFail, "Username", "Username was Empty"
End if