如何在calabash设置keyboard_enter_text超时?

时间:2015-12-04 18:40:05

标签: calabash calabash-ios

问题是我正在尝试使用 keyboard_enter_text 编写一个大文本,并且每次运行此代码时它会停在一半并重新开始,有时它会给我超时错误。

And I write an large post into post field         # features/step_definitions/my_first_steps.rb:27
  Time out waiting for UIAutomation run-loop for command uia.typeString('new post test new post test new post test new post test new post test new post test new post test new post test new post test new post test new post test new post test new post test new post test new post test new post test new post test new post test new post test new post test new post test new post test ', ''). Waiting for index:3 (RunLoop::TimeoutError)
  ./features/step_definitions/my_first_steps.rb:31:in `/^I write an large post into post field$/'
  features/add_post.feature:19:in `And I write an large post into post field'

我已尝试使用 set_text 在文本字段中编写,但已弃用。

我该如何解决?

提前致谢。

2 个答案:

答案 0 :(得分:2)

我们已经开始在具有深层视图层次结构的视图上更频繁地看到这一点。

Calabash在输入之前遍历整个视图层次结构。这是因为UIAutomation中的错误。很长一段时间,Calabash用户会回想起字符串输入错误,字符被跳过或重复,或输入应用程序崩溃的日子。

修复程序在输入之前收集了关于视图层次结构的尽可能多的信息。

解决方法是致电:

uia("uia.typeString('String to type')")

缺点是你不会得到任何Calabash提供的错误检查。我们正在调查这个问题。

答案 1 :(得分:-2)

是的,运行循环有一些时间问题,如果要输入长字符串,还有解决方法。你可以使用相同的字符串减少长度并输入三次:

Then I use the native keyboard to enter "new post test new post test new post test new post " into the "Email" input field
Then I use the native keyboard to enter "new post test new post test new post test new post " into the "Email" input field
Then I use the native keyboard to enter "new post test new post test new post test new post " into the "Email" input field
相关问题