In Tosca, default timeout I have mentioned is 35 seconds. So due to that the if condition taking whole 35secs to fails. Isthr way to mention seperate wait for condition alone.

Need to mention seperate wait for Tosca if condition