窗口10:Appium无法在会话时间内找到Genymotion模拟器

时间:2016-09-29 09:15:38

标签: appium genymotion

  1. 使用来自genymotion网站的VirtualBox下载的Genymotion并正确安装
  2. 在eclipse上添加Genymotion插件并设置Genymotion目录
  3. 添加虚拟设备Nexus9 os版本5.1.0 API 22
  4. 在项目
  5. 下添加Selenium和Appium java客户端jar文件
  6. 使用Genymotion Android工具和自定义Android SDK工具作为Genymotion ADB工具连接设置
  7. 配置Appium设置并运行Appium
  8. 在eclipse上运行以下源代码

    import java.io.IOException;
    import org.apache.commons.exec.CommandLine;
    import org.apache.commons.exec.DefaultExecuteResultHandler;
    import org.apache.commons.exec.DefaultExecutor;
    import org.apache.commons.exec.ExecuteException;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.remote.DesiredCapabilities;
    import org.openqa.selenium.remote.RemoteWebDriver;
    import java.net.URL;
    import io.appium.java_client.android.AndroidDriver;
    public class Firstappium {
    
    static String deviceName = "Nexus9-5.1.0API22";
    static WebDriver driver;
    static String url ="http://127.0.0.1:4720/wd/hub";
    public static void main(String[] args)              {
    
     DefaultExecuteResultHandler resultHandler;
    DesiredCapabilities capabilities = new DesiredCapabilities();
    
    DefaultExecutor executor = new DefaultExecutor();
    resultHandler = new     DefaultExecuteResultHandler();
    
    
    capabilities.setCapability("deviceName","Nexus9-5.1.0API22"); 
    capabilities.setCapability("platformVersion", "5.1");
    capabilities.setCapability("platformName", "Android");
    capabilities.setCapability("app","G:/appium/apk/cz.hipercalc.apk");
    driver = new AndroidDriver(new URL(url),capabilities);
    System.out.println("Appium Driver is launched successfully");
    }
    }
    
    1. 每次Appium都无法在会话时间内找到Genymotion模拟器。请检查附加的屏幕截图 enter image description here

0 个答案:

没有答案