【问题标题】:How to enter a value while running UIAutomation Test on iOS Simulator or Device如何在 iOS 模拟器或设备上运行 UIAutomation 测试时输入值
【发布时间】:2015-05-08 00:23:51
【问题描述】:

我想在 UIAutomation 测试时输入一个值,但我不知道怎么做。 案例:

1- 在 js 中设置了用户代码和密码并点击了按钮。 2-在该手机收到包含代码的消息后。

代码必须输入到文本文件中。

是否可以在测试运行时给出代码?

谢谢

【问题讨论】:

  • 您的模拟器将如何接收消息?是短信还是其他方式?

标签: ios automated-tests instruments ui-automation ios-ui-automation


【解决方案1】:

手机收到一条您想在测试中阅读的短信?我很确定这是不可能的。您不能真正离开正在运行测试的应用程序。如果您从模拟器运行,最好的办法是以某种方式将代码写入某个文件并使用UIAHost.performTaskWithPathArgumentsTimeout

读取它

https://developer.apple.com/library/ios/documentation/UIAutomation/Reference/UIAHostClassReference/index.html#//apple_ref/javascript/instm/UIAHost/performTaskWithPathArgumentsTimeout

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-11
    • 1970-01-01
    • 1970-01-01
    • 2013-10-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多