Forum Discussion

HawkeyesTester's avatar
HawkeyesTester
Occasional Contributor
3 years ago

Assert Step Not Executing All Assertions

I added an Assert step into my test script and within this assert step I've created four individual assertions on various fields. When the assert step is executed, only one of those individual assertions is executed. The others indicate "UNKNOWN" in the message column.

 

I've unchecked both of the following settings in Project Preferences and Test Case Options:

  • "Discards successful test step results to save memory"
  • "Abort test if an error occurs"

 

Is there a project setting that I'm missing that needs to be set to ensure all asserts configured into an Assert step are executed?

2 Replies

  • I am also facing same issue first few Assertion test steps are getting executed and remaining assertion test steps are not executing, showing status as UNKNOWN. But test steps are showing as PASS in Test History.

    If we move same assertion to up in the order it is executing but only issue is with lower ones. However in azure pipeline all are executing and getting correct status.

    How to fix this in ReadyAPI tool so that all test steps to execute?

  • To resolve the issue where only one assertion in the Assert step is executed while others are marked as "UNKNOWN," check the following:

    1. Assertion Logic: Ensure the logic for all assertions is correct. If one assertion fails, it might prevent the others from being executed, particularly if the test flow halts after the first failure.
    2. Project Settings: Even though you’ve unchecked options to discard successful results and abort on errors, check if any other settings in your project may interrupt or limit execution.
    3. Test Case Options: Review the test case settings for any configurations that might prevent subsequent assertions from running, such as error handling options that stop the flow after an error occurs.
    4. Assert Step Configuration: Verify that the Assert step is set up correctly. If the assertions are part of one Assert step, they should all execute unless one encounters a critical issue.
    5. Separate Assert Steps: If necessary, try placing each assertion in its own Assert step. This ensures that each assertion runs independently, even if one fails.
    6. Logs and Debugging: Look for any errors or warnings in the logs that could explain why some assertions are skipped or marked as "UNKNOWN."
    7. Test Step Configuration: Ensure the Assert test step isn't configured to skip or prematurely end due to other settings.

    If these steps don’t resolve the issue, reaching out to support might be necessary for further investigation.