In QTP, we can use below code:
if obj1.exist(5)
obj1.click;
else
obj2.click
We can control the wait time and if one UI exists, we can do some operation.
how to work out the same situation in Monkey Talk with JS?
and can I get the orientation of the IOS device with JS?
Use the following to see if a component exists,
Label * Verify %timeout=10000. This will wait 10 seconds to find a label. You can use JavaScript like the following...To get the orientation you can do the following,
Device * var orientation