【发布时间】:2011-08-12 11:04:33
【问题描述】:
我的警报功能如下:
UIATarget.onAlert = function onAlert(alert)
{
var title = alert.name();
UIALogger.logWarning("Alert with title '" + title + "' encountered!");
if (title == "Installation for this product is actually free with delivery - you will not be charged for installation.")
{
alert.buttons()["OK"].tap();
return true; // bypass default handler
}
return false; // use default handler
}
这里我要执行一个条件,如果出现警告信息我要执行
mainWindowTarget.scrollViews()[0].scrollToElementWithName("Add to cart");
var AddButton = mainWindowTarget.scrollViews()[0].buttons().firstWithName("Add to cart").tap();
所以一旦警报信息出现,上面两行应该被执行
有人可以帮忙吗
【问题讨论】:
标签: javascript iphone ios ios-ui-automation