Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PASS/FAIL in QTP
#1
Let me explain the problem using an example. Lets say I have to validate a login functionality in a web page. Login is success for "login" and "passwd123" user credentials and for rest throws error message.
In the script using Data Driven I try to login using various users. For a valid user, on login success I check the text and if exists I report a message with PASS else FAIL.

Now my question is when I manually execute this test case, when the valid user is allowed to login and for the rest it throws a message. I PASS this test case.

when I run this data driven script with same logic, the QTP summarized result shows FAILED though the script completed successfully.

what is the correct approach. How to go about handling PASS/FAIL in QTP script.
Reply
#2
Hi Badri,

Are you using the conditional statements and then using QTP Pass/Fail?

It should be some thing like
Code:
if (this error message display) then QTP pass else QTP Fail end if
Thanks,
SUpputuri
Reply
#3
Thats fine..I am using the same way. But try to understand my question.

when i execute the testcase for various users(valid n invalid), the manual test case is PASS.
Similarly, when i run as automated, how should i handle the logic for PASS/FAIL.
Reply
#4
Code:
'Valid user name and password username = "abc" password = "def" Call Login("Valid",username,password) 'InValid user name and password username = "xyz" password = "pqr" Call Login("InValid",username,password) 'Login Function Function Login(strValidation,UN,PWD) if strValidation = "Valid" then 'code to validate successful login elseif strValidation = "InValid" then 'code to validate failure login end if End Function
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  To send Fail Results to mail Naresh 1 2,994 04-23-2015, 08:30 PM
Last Post: babu123
  Fail when running multiple actions in QC crissbbbm 0 2,986 08-29-2013, 07:52 PM
Last Post: crissbbbm
  how to pass the data frm datatable silpavinod 3 4,729 10-18-2012, 01:54 PM
Last Post: silpavinod
  how to pass a numeric value into webedit silpavinod 3 4,502 10-15-2012, 01:57 PM
Last Post: silpavinod
  Pass specific design steps in QC through QTP TurtleRock 0 2,067 09-06-2012, 01:23 PM
Last Post: TurtleRock

Forum Jump:


Users browsing this thread: 1 Guest(s)