TestQA1
3 years agoFrequent Contributor
Updating Log.ErrCount value
Hi folks, I have a requirement to fail the gherkin scenario in the Then statement, if the scenario has any Log.Error posted to the test log. I tried using Log.ErrCount, but the problem is that it...
- 3 years ago
Unfortunately it's a read only value.
https://support.smartbear.com/testcomplete/docs/reference/project-objects/test-log/log/errcount.html
You can calculate it though with something like this
at the top of all your tests
set currenterrors = 0
in your if
if log.errcount - currenterrors > 0 then /* you now have more errors than before
error stuff goes here
set currenterrors = log.errcount
else
passed stuff goes here