You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When tests are being ran through TestCase editor, and the particular test step is currently open, then that particular test step's assertions will be ran twice. If the particular test step is closed, the assertions in that test step will run only once. This bug makes tests where assertions are applied only on certain conditions (eg on a second run only), the test results will become ambiguous.
Steps to reproduce
Create a groovy test step: testRunner.testCase.setPropertyValue("runCount","0")
Create a Http request test step (for example GET http://github.com). Add script assertion: int currentRun = Integer.parseInt(messageExchange.modelItem.testStep.testCase.getPropertyValue("runCount")); messageExchange.modelItem.testStep.testCase.setPropertyValue("runCount", (currentRun + 1).toString());
That basically counts, how many times the assertion is run.
Close all windows (in SoapUI) and open TestCase Editor. Run the tests from there.
Check under TestCase Custom properties, there will be written "runCount = 1".
Now open Http request test step, and rerun the tests from TestCase Editor.
Check under TestCase Custom properties, there will be written "runCount = 2", even though the value was reset by the groovy script beforehand and thus should still be 1.
Expected outcome
Whether or not the test step is open, the assertions will still be run once.
The text was updated successfully, but these errors were encountered:
BachmannKarlHendrik
changed the title
Assertions are being ran twice when test step is open
[BUG] Assertions are being ran twice when test step is open
May 3, 2024
Environment
Windows 11
SoapUI 5.7.2
Description
When tests are being ran through TestCase editor, and the particular test step is currently open, then that particular test step's assertions will be ran twice. If the particular test step is closed, the assertions in that test step will run only once. This bug makes tests where assertions are applied only on certain conditions (eg on a second run only), the test results will become ambiguous.
Steps to reproduce
Create a groovy test step:
testRunner.testCase.setPropertyValue("runCount","0")
Create a Http request test step (for example GET http://github.com). Add script assertion:
int currentRun = Integer.parseInt(messageExchange.modelItem.testStep.testCase.getPropertyValue("runCount")); messageExchange.modelItem.testStep.testCase.setPropertyValue("runCount", (currentRun + 1).toString());
That basically counts, how many times the assertion is run.
Close all windows (in SoapUI) and open TestCase Editor. Run the tests from there.
Check under TestCase Custom properties, there will be written "runCount = 1".
Now open Http request test step, and rerun the tests from TestCase Editor.
Check under TestCase Custom properties, there will be written "runCount = 2", even though the value was reset by the groovy script beforehand and thus should still be 1.
Expected outcome
Whether or not the test step is open, the assertions will still be run once.
Project for reproducing the issue
The issue can be reproduced with this project: ProjectForReproducingIssue.zip
The text was updated successfully, but these errors were encountered: