在QTP
中,我们可以使用以下代码:
if obj1.exist(5)
obj1.click;
else
obj2.click
我们可以控制等待时间,如果UI
存在,我们可以做一些操作。
如何解决相同的Monkey Talk
情况JS
?
我可以用 获得IOS
设备的方向JS
吗?
在QTP
中,我们可以使用以下代码:
if obj1.exist(5)
obj1.click;
else
obj2.click
我们可以控制等待时间,如果UI
存在,我们可以做一些操作。
如何解决相同的Monkey Talk
情况JS
?
我可以用 获得IOS
设备的方向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...
try {
app.label().verify(); //if label exists
} catch(Exception err) {
app.debug().print("Label not found");
}
To get the orientation you can do the following, Device * var orientation