Appium x iOSのscrollに対するworkaround

AppiumでiOSアプリに対してスクロール操作を行うとき、以下のworkaroundでうまくいったので、メモ。
Appium1.4.xで動作確認済み。

OS7.0 ~ 8.x系で確認されるOS側不具合で scrollTo やUIAutomatorの scrollToVisible を使うと、以下のようなエラーがでます。

null is not an object (evaluating 'au.getElement('').scrollToVisible')

このworkaroundとして、例えばrubyだと以下で回避可能です。

execute_script("mobile: scroll", direction: "down", element: element.ref)

elementは、find_elementなどで取得できうelementを意味します。

※いつからあったworkaroundだろう。自前で実装してた…

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.