Tuesday, June 30, 2015

MONKEYTALK: SCRIPT TO PROVIDE EXPLICIT WAIT IN MONKEYTALK IDE [MOBILE AUTOMATION]


There is no component or action, available in MonkeyTalk IDE for explicit wait as a step.

We can write parametrized script for the same by leveraging functionality of WaitFor action and %shouldfail modifier.




Same In MonkeyTalk language:

Vars * Define sec
View explicitlyintroducingdelay WaitFor ${sec} %shouldfail=true %timeout=120000

In this script, we are waiting for view with id <explicitlyintroducingdelay> to appear till provided number of seconds <sec>. But there is no view with id <explicitlyintroducingdelay> going to appear so script will continue after waiting for provided seconds as %shouldfail modifier is true.

Now we can call this script whenever explicit wait is required as:

Wait * ForSec 60

Above line will introduce wait for 60 seconds.


No comments:

Post a Comment