Appium Inspector对应用程序图像上的单击没有响应

时间:2018-07-09 04:02:07

标签: android eclipse automation appium appium-desktop

Appium的新手。它的检查器(GUI版本)不响应对应用程序映像的任何单击(单击后,服务器上也没有日志,也没有应用程序源内容)。如果单击“按坐标点击”,则仅在服务器上生成日志。我尝试了appium-desktop-Setup-1.0.2-beta2.exe和appium-desktop-web-setup-1.6.2.exe(v1.8.1),结果都是相同的。

使用的真正测试电话是Moto X Sprint(Android 4.2.2) 日志的开头被复制到下面,并加上代码。

[Appium] Welcome to Appium v1.8.1
[Appium] Non-default server args:
[Appium]   sessionOverride: true
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> GET /wd/hub/sessions
[HTTP] {}
[MJSONWP] Calling AppiumDriver.getSessions() with args: []
[MJSONWP] Responding to client with driver.getSessions() result: []
[HTTP] <-- GET /wd/hub/sessions 200 2 ms - 40
[HTTP] 
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"appActivity":"com.android.vending.AssetBrowserActivity","appPackage":"com.android.vending","deviceName":"My Phone", ... ... 

... ... ...

//我的代码

package tests;

import java.net.MalformedURLException;
import java.net.URL;

import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
import io.appium.java_client.android.AndroidDriver;

public class AppiumTest {

    public static void main(String[] args) {

        //Set the Desired Capabilities
        DesiredCapabilities caps = new DesiredCapabilities();
        caps.setCapability("deviceName", "My Phone");
        caps.setCapability("udid", "LXSZ2A0007"); //Give Device ID of your mobile phone
        caps.setCapability("platformName", "Android");
        caps.setCapability("platformVersion", "4.2.2");
        caps.setCapability("appPackage", "com.android.vending");
        caps.setCapability("appActivity", "com.android.vending.AssetBrowserActivity");
        caps.setCapability("noReset", "true");

        //Instantiate Appium Driver
        try {
                AppiumDriver<MobileElement> driver = new AndroidDriver<MobileElement>(new URL("http://0.0.0.0:4723/wd/hub"), caps);

        } catch (MalformedURLException e) {
            System.out.println(e.getMessage());
        }
    }

}

请注意,它指向顶部的“ Google Play”(请参见下面的屏幕截图)。无论我在图像上指向何处,都没有任何反应。

Screenshot of the App Image

1 个答案:

答案 0 :(得分:0)

您还可以使用UIAutomatorViewer查找可以在Android sdk下找到的元素。