【发布时间】:2011-09-06 15:39:06
【问题描述】:
我正在自动化 iPhone 应用程序
当我在 TO: 字段中输入邮件 ID 并单击发送时,我收到带有两个按钮的确认警报
“取消”和“发送”。
默认按钮是“取消”。我无法点击发送按钮。
这是我使用的代码 sn-p。请帮我解决这个问题
//获取句柄
window = UIATarget.localTarget().frontMostApp().mainWindow();
target = UIATarget.localTarget();
app = target.frontMostApp();
buttons = window.buttons();
target.delay(2);
//点击导航栏上的发送按钮
app.navigationBar().buttons()["Send"].tap();
target.delay(2);
//警报处理程序
UIATarget.onAlert = function onAlert(alert)
{
//Unable to enter this portion of the code
target.delay(2);
var alerttitle = alert.name();
UIALogger.logMessage("Alert with title: '"+alerttitle+"' encountered! ");
}
控件根本不在处理程序内部。
【问题讨论】:
标签: javascript iphone cocoa-touch automation