Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Checkpoints - How to differential from Actual behavior to Expected Behavior
#1
Solved: 11 Years, 4 Months ago
Good Afternoon,

This is my first post here on this Forum. So please excuse me if i have not posted in the correct area.

I am fairly new to the functionality of QTP. I went thru the tutorial. I am able to perform various tests in our application, that is only when the behavior is as expected. How do i handle unexpected behavior.

Simple Scenario:

Expected:
1. url
2. enter username, password
3. Login
4. Logout

If i disable to user:
1. url
2. enter username, password
3. after clicking the Login button, it routes me to a different page saying "user has been disabled" - at this point the script just hangs and there is an exception to stop, debug or skip.

How do I handle this, so the script can complete as failed instead of throwing an exception. I understand the basics of checkpoints, but how to set a checkpoint to continue a certain way if the login button routes me to a different page.

Please advise.


Thanks,
rd
Reply
#2
Solved: 11 Years, 4 Months ago
Hi,

I guess you can insert a simple checkpoint like.

Browser().Page().Webelement().check(checkpoint()) which will give you a value in the boolean and then have a reporter statement like

Code:
If Pass then
Reporter.Reportevent micpass, "Text appeared", "Test Passed"
Else
Reporter.reportevent micfail, "Text did not appeared","Test Failed"
Let us know if this helps.
Reply
#3
Solved: 11 Years, 4 Months ago
Tarik,

This is stuff is very new to me. I am going to try what you started and get back to you on my progress/questions.

Thanks,
rd
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  WinList Behavior marse91782 0 2,940 11-24-2016, 06:32 AM
Last Post: marse91782
  Why not Checkpoints subhashinid 0 1,610 06-30-2016, 07:36 PM
Last Post: subhashinid
  Expected End statement error Lavanya N 2 5,167 07-27-2015, 01:52 PM
Last Post: Lavanya N
  How to check expected cookies are present or not priyanka.agarwal 0 1,974 07-02-2015, 12:43 PM
Last Post: priyanka.agarwal
  Validate Numeric value is displaying expected format kalaivanan123 1 3,508 09-23-2013, 08:45 PM
Last Post: ravi.gajul

Forum Jump:


Users browsing this thread: 4 Guest(s)