felipexlr50
7 years agoNew Contributor
Loadtest teardown script not working
Hi, I am tying to setup a teardown script in the load test to verify the test results, but the teardown script seems to not run after the loadtest, I tested with a log.info in the setup script and in...
- 7 years ago
The script is run, but logging is disabled. For example, if your Teardown script is
assert 1 == 2
then after running the LoadTest, you will see the Assertion error in the Error Log.
I checked the soapui.log, and I saw:
2018-08-18 09:31:55,204 INFO [log] test 1 2018-08-18 09:31:55,204 INFO [SoapUI] Disabling logs during loadtests 2018-08-18 09:32:00,255 INFO [SoapUI] Enabled logs after loadtests
So it looks like logging is disabled after the Setup Script, and enabled again after the Teardown script.
Looks like there's a UI option for it:
File > Options > UI Settings > Do not disable the groovy log when running load tests
(you will get logging on your TestSteps, which might impact performance)I checked the source, and the mechanism of disabling the log is:
Logger.getLogger("groovy.log").setLevel(Level.OFF);
So you could do this at the start of your Teardown script:
log.setLevel (org.apache.log4j.Level.INFO)