Forum Discussion

douglasv's avatar
douglasv
Occasional Contributor
6 years ago
Solved

Validate if object does not exist

Hi everyone

I'd like to know if this part of code is the best way to validate if some object does not exist......and if is,  best way to do not waste time to checking it. I don't know it there is a method to check NotExist.

Thank you so much.

var TimeoutValue;
TimeoutValue = Options.Run.Timeout;
Options.Run.Timeout = 1000;
if( (! browseTelaSelecionaControle.Controle15.Exists)&&
(! browseTelaSelecionaControle.Controle95.Exists)){
Log.Checkpoint("Controls are NOT visible");
}
else{
Log.Error("Controls ARE visible");
}
Options.Run.Timeout = TimeoutValue;