Forum Discussion
- mpartykaContributor
Add a groovy test step
// -----------------------------------------------------------------------------------------------------------------------
// Check the assertion status of test step 'TEST_STEP_NAME'
// -----------------------------------------------------------------------------------------------------------------------def assert_status1 = testRunner.testCase.getTestStepByName("TEST_STEP_NAME").getTestRequest().getAssertionStatus().toString()
log.info " Assert status for 'TEST_STEP_NAME' = $assert_status1" - nmraoChampion Level 3
Here you go:
def isTestPass = false
assert isTestPass, "The value of isTestPass variable is ${isTestPass}"
EDIT:
I was under impression that how to log the failure message to Test Report. Hence the above example is show.
After posting the above example, it is realized that you want the way.
My question to is this - why do you need a reason saying assertion passed in the passed test? The entire test is passed already i.e., assertions are passed, why would some be interested in their time here? Instead focus time on failures.
If you do not mind, may I ask you what is your use case. Facing this kind of topic for the very first time from ever since I participate in the forum.
- gid_216Frequent Contributor
My test generates an id for few activities and those id's will be part of response. We randomly pick some of these ids from passed test case and use those for manual test flow (as the process of generating id, is lengthy and consumes more time while doing manually from UI) and it is difficult to track which id is related to a passed testcase.
- gpavanptestingNew Contributor
Related Content
- 2 years ago
- 7 years ago
- 10 years ago
Recent Discussions
- 8 days ago