Основные элементы деятельности (с меню инструментов сторонних производителей) не найдены в Appium - Eclipse - PullRequest
0 голосов
/ 24 октября 2018

UIAutomator - Main Activity Page

Код затмения для поиска элемента:

`

System.out.println("Context"+driver.getContext() + "Activity: " + 
     driver.currentActivity());
     //Finding element action_search
    try{

    driver.findElement(By.id("com.shopioca.shop:id/action_search")).click();}catch(Exception e){}
        try{
        driver.findElement("android.widget.TextView", "com.shopioca.shop:id/action_search").click();}catch(Exception e1){}
        try{
        driver.findElementByAccessibilityId("Find Order").click();}catch(Exception e1){}
        try{
        driver.findElementByAndroidUIAutomator("new UiSelector().resourceId(\"com.shopioca.shop:id/action_search\")").click();}catch(Exception e1){}
        try{
        driver.findElement(MobileBy.AndroidUIAutomator("new UiSelector().resourceId(\"com.shopioca.shop:id/action_search\")")).click();}catch(Exception e1){}
        try{
        driver.findElementByClassName("android.widget.TextView").click();}catch(Exception e1){}
        try{
        driver.findElementByXPath("//android.widget.TextView[contains(@resource-id,'com.shopioca.shop:id/action_search')]").click();}catch(Exception e1){}
        try{
        driver.findElementByXPath("//android.widget.TextView[contains(@condent-desc,'Find Order')]").click();}catch(Exception e1){}
        try{
        driver.findElementByXPath("//android.support.v7.widget.LinearLayoutCompat[@index='3']/android.widget.TextView[@index='0']").click();}catch(Exception e1){}
`

Сервер Appium - Ошибка:

[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//android.widget.TextView[contains(@resource-id,'com.shopioca.shop:id/action_search')]","context":"","multiple":false}}
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding '//android.widget.TextView[contains(@resource-id,'com.shopioca.shop:id/action_search')]' using 'XPATH' with the contextId: '' multiple: false
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Failed to locate element. Clearing Accessibility cache and retrying.
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding '//android.widget.TextView[contains(@resource-id,'com.shopioca.shop:id/action_search')]' using 'XPATH' with the contextId: '' multiple: false
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":7,"value":"No element found"}
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [MJSONWP] Matched JSONWP error code 7 to NoSuchElementError
[debug] [BaseDriver] Waited for 21331 ms so far

Не удалось найти ни одного элемента на этой странице.Элементы активности входа найдены и успешно доставлены на главную страницу активности.Но я не смог найти ни одного элемента на этой странице.Пожалуйста, совет, заранее спасибо.

1 Ответ

0 голосов
/ 25 октября 2018

При установке драйвера Appium-UiAutomator2 решена проблема с поиском элементов Меню ящика.

...