Is it possible to call assert with my own test result (Pass or Fail)?
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is it possible to call assert with my own test result (Pass or Fail)?
Hi,
I would like to know if it's possible if I validate the test results with my own logics then call the assertion script to either pass/true or fail/false based on my own reasoning? thanks
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you trying to validate each testcase with 'Script Assertion (groovy script)'?
If so, then you can pass or fail that script by using 'assert' then pass a true or false (boolean) condition on it, true (passed), false (failed)
e.g. def getTotalNumbers = totalNumbersFromResponse; def expectedTotal = 10; assert getTotalNumbers == expectedTotal; // if both matches, your testcase will pass, else fail
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks. I didn't know why I didn't do this "assert true"
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The reason I want to validate my own test result because I test one of the features that member requires license to perform the operation. Since the license team hasn't fixed their defects and I cant fail that tested feature because the developer who owns that feature says it's not the functionality fault, it's the requirement does not meet so he wants me to pass the test case rather fail or block it. Sometimes developers just have their own reasoning when deciding whether to pass or fail the test.
