Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 11 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(7)
你好,Lalith,我一直在为应用程序创建一些 UI 自动化测试,并且运行得很好。虽然它有一些技巧,但我认为您应该看看这些链接:
http://answers.oreilly.com/topic/1646-how-to-use-uiautomation-to-create-iphone-ui-tests/
http://alexvollmer.com/posts/2010/07/03/working- with-uiautomation/
如果您需要更多帮助,请告诉我。 :)
Edit1:
在 viewController 的 viewDidLoad 上,您可以添加如下内容:
编辑 2:
Hello Lalith i have been creating some UI Automation tests for an application and its working very well. Although it has some tricks, I think you should take a look at these links:
http://answers.oreilly.com/topic/1646-how-to-use-uiautomation-to-create-iphone-ui-tests/
http://alexvollmer.com/posts/2010/07/03/working-with-uiautomation/
If you need more help, just let me know. :)
Edit1:
On your viewDidLoad of your viewController you can add something like this:
Edit 2:
Apple 有一个通过仪器和可访问性 API 实现基于 javascript 的自动化的框架。它不是 100% 最好的,但值得一看。
仪器 + 用手指实际触摸手机也是“在现实世界中”进行性能分析的一种非常好的方法。
一般来说,我认为自动化 UI 测试不值得。 UI 通常变化太大,以至于功能规范的工作量低于其价值。 YMMV。
Apple has a framework for javascript-based automation via instruments and the accessibility APIs. It's not 100% awesome the best, but it's worth taking a look.
Instruments + actually touching the phone with your finger is a pretty good way to do performance analysis "in the real world" as well.
Generally, I haven't found it worthwhile to automate UI testing. The UI generally changes too much to make a functional spec less work than it's worth. YMMV.
一旦您达到了满意的程度,我就会看看这个 KIF 框架。
Once you get to a point you are comfortable, I would look at this KIF framework.
您可以创建一个父
UIView
,向其中添加“子视图”或子视图。子视图包含您的应用程序 UI。父视图设置为透明,它捕获触摸并记录它们。记录后,触摸事件将传递到子视图。您可以将您的测试结果发送到此处。
由于父视图是透明的,用户永远看不到它,但它仍然捕获并处理触摸事件。
设置此功能将涉及大量子类化,并且某些类(例如
UIWebView
)会带来困难。但这可能是可行的。You could create a parent
UIView
, to which you add "children" or subviews. The subviews contain your application UI.The parent view is set up to be transparent, and it captures touches and logs them. Once logged, the touch event is passed down to the subviews. You could send your test touches here.
Because the parent view is transparent, the user never sees it, but it still captures and processes touch events.
Setting this up would involve a fair amount of subclassing, and some classes (such as
UIWebView
) introduce difficulties. But it might be feasible.感谢您的帮助。正如我在评论中提到的,我应该能够在 IOS 设备中独立运行它们。我们可以按照此处所述使用sendActionsForControlEvents。
这就是我现在所需要的。
Thanks for all your help. As I have mentioned in a comment that I should be able to run them in IOS device as stand alone. We can use sendActionsForControlEvents as described here .
This is all I need for now.
您可以考虑SeeTest from Experitest,它具有非常简单的记录和重播功能。
You can consider SeeTest from Experitest, it comes with very easy record and replay capabilities.
我在 iOS 自动化中使用 IMAT 非常成功。
https://code.intuit.com/sf/sfmain/do/viewProject /projects.ginsu
我喜欢它的原因:
I've been using IMAT quite successfully for iOS automation.
https://code.intuit.com/sf/sfmain/do/viewProject/projects.ginsu
Reasons I like it: