18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
BUG detected (see 3rd) Is there a way to know if errors are on the way
In scripts, I use asserts because it is the normal way to write test and well supported by Sahi and well rendered in the report.
In one script I have two parts which run one after the other automatically.
But I'd like to make some decision after the first part, for instance to stop if some asserts where false.
Are there some global variables we can test telling whether at the current point some errors are already present? for example something that could be retreive along with _sessionInfo() or alike
--
Also, I tried
Why is the error never caught? I thought that _asserts where throwing exceptions?
In one script I have two parts which run one after the other automatically.
But I'd like to make some decision after the first part, for instance to stop if some asserts where false.
Are there some global variables we can test telling whether at the current point some errors are already present? for example something that could be retreive along with _sessionInfo() or alike
--
Also, I tried
try{
_assertContainsText("some missing text", document.body);
}catch(e){
_alert('caught');
}
Why is the error never caught? I thought that _asserts where throwing exceptions?
Comments
I really need to know while the srcipt is running if some asserts where not true.
How can I put the result of an assert in a variable and have an "if" on that variable ?
May be simple, but after trying different things I do not know where to go.
The assert is on wether a "phrase" is present or not on the page.
If present, I do action A, if not, I do action B.
Could some one help me on that ?
In my first script, I have The first line appears in green in the log
The second in red in the log.
Now, I revert the two lines : In the log, the first line is no more red, it is blank
In the log, the second is no more green, it is red
Why ?