Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Checkpoints with Functions
#1
Solved: 10 Years, 9 Months, 1 Week ago
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
Reply
#2
Solved: 10 Years, 9 Months, 1 Week ago
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Why not Checkpoints subhashinid 0 1,477 06-30-2016, 07:36 PM
Last Post: subhashinid
  Perform some functions whenever QTP Stop button is pressed smartkarthi 2 2,943 08-22-2013, 11:43 AM
Last Post: smartkarthi
  exit parent functions as well Shridevi.Salagare 3 3,604 07-31-2013, 12:15 AM
Last Post: Ankur
  Query about checkpoints pkdhake 5 3,466 07-11-2013, 03:17 PM
Last Post: vinod123
  Datatable in functions shwetasharma 2 3,290 03-26-2013, 08:00 AM
Last Post: sams001

Forum Jump:


Users browsing this thread: 1 Guest(s)