简体   繁体   English

iOS UI自动化可以执行应用代码吗?

[英]Can iOS UI automation execute app code?

I understand that I can query elements and invoke user commands on them, such as tap or swipe. 我了解我可以查询元素并在元素上调用用户命令,例如点击或滑动。 Can I call actual code though? 我可以调用实际代码吗? For example if I have a foo method on the current view controller or a static Bar method in a utility class, can I call them during my test? 例如,如果我在当前视图控制器上有一个foo方法,或者在实用程序类中有一个静态Bar方法,我可以在测试过程中调用它们吗? Something like: 就像是:

  1. Locate button and tap it 找到按钮并点按它
  2. Call some method 调用一些方法
  3. query field of some text box 一些文本框的查询字段

If the answer is yes, can I do it in Appium as well? 如果答案是肯定的,我也可以在Appium中做到吗?

您不能从UI自动化执行任何代码,但是可以执行UI事件,并使用它们可以执行代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM