本文介紹了無法創(chuàng)建新的遠(yuǎn)程會(huì)話。Appium應(yīng)用程序的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
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);
}
當(dāng)我嘗試運(yùn)行測(cè)試時(shí),收到此錯(cuò)誤。
org.openqa.selenium.SessionNotCreatedException:無法創(chuàng)建新的
遠(yuǎn)程會(huì)話。所需功能=功能
[{platformName=Android,deviceName=F4AZFG07P508}],必填
Capability=Capability[{}]內(nèi)部版本信息:版本:‘3.3.1’,
版本:‘5234b325d5’,時(shí)間:‘2017-03-10 09:10:29+0000’系統(tǒng)信息:
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’驅(qū)動(dòng)程序信息:driver.version:AndroidDriver
我認(rèn)為我在Appium中設(shè)置的一切都是正確的(當(dāng)檢查器啟動(dòng)時(shí),設(shè)備是已安裝的應(yīng)用程序,可以進(jìn)行測(cè)試)
作為項(xiàng)目收集器,我使用Maven
更新。
我正在嘗試使應(yīng)用程序自動(dòng)化。我在代碼中指定了附加功能
@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);
和錯(cuò)誤相同
org.openqa.selenium.SessionNotCreatedException:無法創(chuàng)建新的
遠(yuǎn)程會(huì)話。所需功能=功能
[{app=/Users/romanderabin/Downloads/TimeTracker.apk,
appPackage=com.ronasit.timetrackerandroid,
appActivity=com.ronasit.timetrackerandroid.MainActivity,
PlatformVersion=5.0,PlatformName=Android,DeviceName=F4AZFG07P508}],
必需的功能=功能[{}]內(nèi)部版本信息:版本:
‘3.3.1’,審校:‘5234b325d5’,時(shí)間:‘2017-03-10 09:10:29+00000’
系統(tǒng)信息:主機(jī):‘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’驅(qū)動(dòng)程序
信息:driver.version:AndroidDriver這篇關(guān)于無法創(chuàng)建新的遠(yuǎn)程會(huì)話。Appium應(yīng)用程序的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,