Appium用于iOS的操作在显示视频广告的屏幕上查找元素时间过长。

huangapple 未分类评论50阅读模式
英文:

Appium for iOS takes too long to find an element on a screen which displays a video advertisement

问题

我试图在iOS原生应用程序的屏幕上找到一个覆盖层,其中显示了这些组件:

  • 一个带有文本"Advertisement"的标签
  • 一个带有文本"skip ad"的按钮
  • 中间的一个容器,显示大约10秒钟的视频广告

在显示这个覆盖层的时刻,我尝试通过文本"Advertisement"来查找一个元素,作为确认我处于正确的屏幕上的一种方式。

这个覆盖层的行为是,视频广告播放结束的时候它会关闭。视频持续时间大约10秒。

我的脚本是:

driver.findElement(MobileBy.AccessibilityID("Advertisement"))

这个覆盖层是什么样子?

Appium用于iOS的操作在显示视频广告的屏幕上查找元素时间过长。

问题是什么?

  1. findElement(来自Appium Desktop)命令花费太长时间来响应并返回结果。这是Appium的控制台日志:
    Appium用于iOS的操作在显示视频广告的屏幕上查找元素时间过长。

  2. 如果你注意到findElement的执行时间是16882毫秒(16秒),几乎等于视频播放和结束的时间。

  3. **重要:**当我尝试在Appium Desktop手动查找时(在视频完成后),可以找到该元素,但是当我运行自动化脚本时找不到它。这给人一种印象,即在视频播放时Appium的进程/请求在某种程度上被阻塞,直到视频结束时才恢复。

是否有人在显示视频广告的屏幕上遇到过类似的问题?

英文:

I'm trying to find an element on a screen of an iOS native app which is an overlay that displays these components:

  • A label with text as "Advertisement"
  • A button with text "skip ad"
  • A container in the middle which displays a video advertisement for around 10 seconds

The moment this overlay is displayed, I try to find an element with text as "Advertisement" as a way to identify that I'm on the correct screen.

The behaviour of this overlay is that it closes the moment the video advertisement finishes playing. Video duration is of ~ 10 seconds.

My script is:

driver.findElement(MobileBy.AccessibilityID("Advertisement"))

What does the overlay look like?

Appium用于iOS的操作在显示视频广告的屏幕上查找元素时间过长。

What is the issue?

  1. findElement (from Appium Desktop) command takes too long to respond back with results. This is the Appium console log:
    Appium用于iOS的操作在显示视频广告的屏幕上查找元素时间过长。

  2. If you notice the time it takes for the find element to finish execution is 16882 ms (16 seconds) which is almost the same amount of time the video takes to play and finish.

  3. IMP: The element is found (after the video completes) when I try to find it manually using Appium Desktop, but never found when I run an automated script. It gives an impression that Appium's process/request somehow gets blocked while the video is playing and resumes only when the video finishes.

Has anyone faced such similar issues with screens displaying video advertisements?

huangapple
  • 本文由 发表于 2020年7月26日 15:09:23
  • 转载请务必保留本文链接:https://java.coder-hub.com/63097166.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定