笑笑笑敏 发表于 2017-8-23 11:01:01

appium运行过程没报错,但没办法运行

刚开始学习,一个简单的测试用例源码如下
:package com.test;

import io.appium.java_client.AppiumDriver;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;

import java.io.File;
import java.net.URL;
import java.util.List;


public class FirstTest{
        private static final int user_phoneno_edt = 0;
        private AppiumDriver driver;
        @Before
        public void setUp() throws Exception{
        DesiredCapabilities capabilities=new DesiredCapabilities();
        capabilities.setCapability(CapabilityType.BROWSER_NAME,"");
        capabilities.setCapability("platformName","Android");
        capabilities.setCapability("devicesName","9DS8FYGAJFPRQW7T");
        capabilities.setCapability("platformVersion","6.0");
       
        capabilities.setCapability("appPackage","com.greenpoint.android.mc10086.activity");
        capabilities.setCapability("appActivity","com.leadeon.cmcc.base.StartPageActivity");
       
        AppiumDriver diver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);
        }
       
        @After
        public void tearDown() throws Exception{
                driver.quit();
        }
       
        @Test
        public void testfirst(){
                driver.findElementById("com.greenpoint.android.mc10086.activity:id/mine_login_btn").click();
        }
}

依赖的jar包也导入了,但是点击运行就出现下面的窗口:C:\Users\lenovo\Desktop

笑笑笑敏 发表于 2017-8-23 11:03:23

照片没有正确上传,弹出窗口在这

finomy 发表于 2017-8-23 16:44:43

很久没用appium了,不需要指定安装包路径么。还有是一运行就报错还是运行过程中报错?app有没有安装启动成功?有可能是selenium和appium版本不对。没有其它错误信息么
页: [1]
查看完整版本: appium运行过程没报错,但没办法运行