Q1:
未安装APP直接启用appium sever,初始化driver :driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);报错:org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: No app set; either start appium with --app or pass in an ‘app‘ value in desired capabilities, or set androidPackage to launch pre-existing app on device)
A1:初始化Android driver,它操作的对象必须是一个App(疑惑脸?),所以连接模拟机或真机调试之前,需保证测试APP已安装成功
Q2.替换最新jar包:java-client-5.0.4.jar和selenium-server-standalone-3.6.0.jar,
运行case报错:ClassNotFoundException: net.sf.cglib.proxy.MethodInterceptor
原因:不甚清楚,只知道cglib是一个动态代理的库,可以实现对一个类对象的代理,而不要求实现接口。
A2:下载(地址:http://cglib.sourceforge.net)最新cglib JAR包(cglib-3.2.5.jar和cglib-nodep-3.2.5.jar),并导入项目