現在、Android上でAppiumとrubyを使っていくつかの自動化テストを行っていますが、テストの1ステップは非常に遅いです。何が起こるかは、appiumがホーム画面の上にドロップするメニューボタンをクリックすることです。その後、メニューのボタンを探します。この時点では非常に遅くなります。ホーム画面には、ボタンのテキストと正確に一致するテキストがあり、これを変更することはできないため、テキストで検索することはできません。そのように、私はコンテンツdescで検索していますが、これは永遠にかかるようです。Appium(Android)&Rubyがオーバーレイの要素を見つけるのが遅い
これをスピードアップする方法はありますか? appiumにオーバーレイを見て、オーバーレイの背後にあるものを無視する方法はありますか?
これは、長い時間がかかるappiumログの例です。
[HTTP] --> POST /wd/hub/session/9d9d5814-2085-4f25-bb5e-e4cc0838fa25/elements {"using":"id","value":"Performances button"}
[MJSONWP] Calling AppiumDriver.findElements() with args: ["id","Performances button"...
[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"Performances button","context":"","multiple":true}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"Performances button","context":"","multiple":true}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding 'Performances button' using 'ID' with the contextId: '' multiple: true
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[RESOURCE_ID=uk.co.bbc.music:id/Performances button]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[RESOURCE_ID=uk.co.bbc.music:id/Performances button]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (0)
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[INSTANCE=0, RESOURCE_ID=uk.co.bbc.music:id/Performances button]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[RESOURCE_ID=android:id/Performances button]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[RESOURCE_ID=android:id/Performances button]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (0)
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[INSTANCE=0, RESOURCE_ID=android:id/Performances button]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[DESCRIPTION=Performances button]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[DESCRIPTION=Performances button]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (0)
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[DESCRIPTION=Performances button, INSTANCE=0]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (1)
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[DESCRIPTION=Performances button, INSTANCE=1]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":0,"value":[{"ELEMENT":"11"}]}
[debug] [AndroidBootstrap] Received command result from bootstrap
[MJSONWP] Responding to client with driver.findElements() result: [{"ELEMENT":"11"}]
[HTTP] <-- POST /wd/hub/session/9d9d5814-2085-4f25-bb5e-e4cc0838fa25/elements 200 80730 ms - 90
find_elementsまたはdriver.find_element(id => "あなたのID")を使用していますか? – archon92
私は次の要素を含むfind要素関数を持っています 'if(is_android) \t \t#リソースIDで検索(Androidのみ)。 \t \t要素= $ driver.find_elements(:ID、ELEMENT_NAME) \t \t IF(elements.size()> 0) \t結果=要素[0] \t \t \tリターン結果 \t \t端 \t end' これは非常に時間がかかります。 – sohaib