无法创建新的远程会话。Appium应用程序
public class StartFirstJobTest {
AppiumDriver driver;
@BeforeTest
public void setUp() throws Exception {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName", "F4AZFG07P508");
//capabilities.setCapability("platformName","Android");
//capabilities.setCapability("platformVersion", "5.0");
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
}
当我尝试运行测试时,收到此错误。
org.openqa.selenium.SessionNotCreatedException:无法创建新的 远程会话。所需功能=功能 [{platformName=Android,deviceName=F4AZFG07P508}],必填 Capability=Capability[{}]内部版本信息:版本:‘3.3.1’, 版本:‘5234b325d5’,时间:‘2017-03-10 09:10:29+0000’系统信息: host:‘macbook-Pro-Roman.local’,IP:‘fe80:0:0:0:77:aef0:77:32%en0’, os.name:‘Mac OS X’,os.arch:‘x86_64’,os.version:‘10.12.3’, java.version:‘1.8.0_121’驱动程序信息:driver.version:AndroidDriver
我认为我在Appium中设置的一切都是正确的(当检查器启动时,设备是已安装的应用程序,可以进行测试)
作为项目收集器,我使用Maven
更新。 我正在尝试使应用程序自动化。我在代码中指定了附加功能
@BeforeTest
public void setUp() throws Exception {
File app = new File("/Users/romanderabin/Downloads/TimeTracker.apk");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName","F4AZFG07P508");
capabilities.setCapability("platformVersion", "5.0");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("app", app.getAbsolutePath());
capabilities.setCapability("appPackage", "com.ronasit.timetrackerandroid");
capabilities.setCapability("appActivity","com.ronasit.timetrackerandroid.MainActivity");
driver = new AndroidDriver(new URL("http://127.0.0.1:4727/wd/hub/"), capabilities);
和错误相同
org.openqa.selenium.SessionNotCreatedException:无法创建新的 远程会话。所需功能=功能 [{app=/Users/romanderabin/Downloads/TimeTracker.apk, appPackage=com.ronasit.timetrackerandroid, appActivity=com.ronasit.timetrackerandroid.MainActivity, PlatformVersion=5.0,PlatformName=Android,DeviceName=F4AZFG07P508}], 必需的功能=功能[{}]内部版本信息:版本: ‘3.3.1’,审校:‘5234b325d5’,时间:‘2017-03-10 09:10:29+00000’ 系统信息:主机:‘macbook-Pro-Roman.local’,IP: ‘fe80:0:0:0:77:aef0:77:32%en0’,os.name:‘Mac OS X’,os.arch: ‘x86_64’,os.version:‘10.12.3’,java.version:‘1.8.0_121’驱动程序 信息:driver.version:AndroidDriver
相关文章