Error[8]: Undefined offset: 2, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

概述我试图自动化一个Android混合应用程序,但得到以下错误:1)Exceptioninthread“main”org.openqa.selenium.WebDriverException:Itisimpossibletocreateanewsessionbecause‘createSession’whichtakesHttpClient,InputStreamandlongwasnotfoundorit

我试图自动化一个Android混合应用程序,但得到以下错误:

1) Exception in thread “main” org.openqa.selenium.WebDriverException: It is impossible to create a new session because ‘createSession’ which takes httpClIEnt, inputStream and long was not found or it is not accessible

2) Caused by: java.lang.reflect.InvocationTargetException

3) Caused by: org.openqa.selenium.WebDriverException: No such context found.

4) NoSuchContextError: No such context found.

以下是我正在尝试执行的代码

package Demo;import java.net.MalformedURLException;import java.net.URL;import java.util.Set;import org.openqa.selenium.By;import org.openqa.selenium.remote.CapabilityType;import org.openqa.selenium.remote.DesiredCapabilitIEs;import io.appium.java_clIEnt.AppiumDriver;import io.appium.java_clIEnt.MobileElement;import io.appium.java_clIEnt.androID.AndroIDDriver;public class NewTest {private static AndroIDDriver<MobileElement> driver;public static voID main(String[] args) throws MalformedURLException, InterruptedException {DesiredCapabilitIEs capabilitIEs = new DesiredCapabilitIEs();capabilitIEs.setCapability(CapabilityType.broWSER_name, "androID");capabilitIEs.setCapability("devicename", "ZY223ZMPG6");capabilitIEs.setCapability("platformVersion", "7.0");capabilitIEs.setCapability("platformname", "AndroID");capabilitIEs.setCapability("autoGrantPermissions","true");capabilitIEs.setCapability("appPackage", "com.equationswork.enis");capabilitIEs.setCapability("appActivity", "com.equationswork.enis.MainActivity");capabilitIEs.setCapability("--session-overrIDe","true");capabilitIEs.setCapability("autoWebvIEw","true");capabilitIEs.setCapability("ChromedriverExecutable","C:\Users\Anjani \AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe");AppiumDriver<MobileElement> driver = new AndroIDDriver<MobileElement>(new  URL("http://0.0.0.0:4723/wd/hub"), capabilitIEs);        //driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);        Thread.sleep(5000);        //System.out.println(driver.getPageSource());Set<String> contextnames = driver.getContextHandles();for (String contextname : contextnames) { System.out.println(contextnames); //prints out something like   NATIVE_APP \n WEBVIEW_1        }driver.context((String) contextnames.toArray()[1]);driver.context("WEBVIEW_1");driver.findElement(By.ID("btnGuest")).click();//driver.quit();    }}Following are the errors thrown:Exception in thread "main" org.openqa.selenium.WebDriverException: It is impossible to create a new session because 'createSession' which takes httpClIEnt, inputStream and long was not found or it is not accessibleBuild info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z'System info: host: 'DESKtop-Lahp4RL', ip: '10.0.0.65', os.name: 'windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_171'Driver info: driver.version: AndroIDDriver    at io.appium.java_clIEnt.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:182)    at io.appium.java_clIEnt.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:196)    at io.appium.java_clIEnt.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:218)    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)    at io.appium.java_clIEnt.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)    at io.appium.java_clIEnt.AppiumDriver.execute(AppiumDriver.java:1)    at io.appium.java_clIEnt.androID.AndroIDDriver.execute(AndroIDDriver.java:1)    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:207)    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:130)    at io.appium.java_clIEnt.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:38)    at io.appium.java_clIEnt.AppiumDriver.<init>(AppiumDriver.java:84)    at io.appium.java_clIEnt.AppiumDriver.<init>(AppiumDriver.java:94)    at io.appium.java_clIEnt.androID.AndroIDDriver.<init>(AndroIDDriver.java:88)    at Demo.NewTest.main(NewTest.java:31)Caused by: java.lang.reflect.InvocationTargetException    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)    at sun.reflect.NativeMethodAccessorImpl.invoke(UnkNown Source)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(UnkNown Source)    at java.lang.reflect.Method.invoke(UnkNown Source)    at io.appium.java_clIEnt.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:172)    ... 13 moreCaused by: org.openqa.selenium.WebDriverException: No such context found.Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z'System info: host: 'DESKtop-Lahp4RL', ip: '10.0.0.65', os.name: 'windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_171'Driver info: driver.version: AndroIDDriverremote stacktrace: NoSuchContextError: No such context found.    at AndroIDDriver.callee
还有一件事,请使用string.contains(“WEBVIEW”)为每个循环再使用一个来切换上下文
[+++]$(C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-androID-driver\lib\commands\context.Js:49:11) at tryCatch (C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.Js:67:40) at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.Js:315:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.Js:100:21) at GeneratorFunctionPrototype.invoke (C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.Js:136:37) at <anonymous> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(UnkNown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(UnkNown Source) at java.lang.reflect.Constructor.newInstance(UnkNown Source) at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$new[+++](W3CHandshakeResponse.java:57) at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$getResponseFunction(W3CHandshakeResponse.java:104) at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession[+++](ProtocolHandshake.java:123) at java.util.stream.ReferencePipeline.accept(UnkNown Source) at java.util.Spliterators$ArraySpliterator.tryAdvance(UnkNown Source) at java.util.stream.ReferencePipeline.forEachWithCancel(UnkNown Source) at java.util.stream.AbstractPipeline.copyIntoWithCancel(UnkNown Source) at java.util.stream.AbstractPipeline.copyInto(UnkNown Source) at java.util.stream.AbstractPipeline.wrapAndcopyInto(UnkNown Source) at java.util.stream.FindOps$FindOp.evaluateSequential(UnkNown Source) at java.util.stream.AbstractPipeline.evaluate(UnkNown Source) at java.util.stream.ReferencePipeline.findFirst(UnkNown Source) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126) ... 18 moreFollowing is the selenium server log[Appium] Welcome to Appium v1.8.0[Appium] Appium REST http interface Listener started on 0.0.0.0:4723[http] --> POST /wd/hub/session[http] {"desiredCapabilitIEs":{"appActivity":"com.equationswork.enis.MainActivity","appPackage":"com.equationswork.enis","ChromedriverExecutable":"C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe","platformVersion":"7.0","autoGrantPermissions":"true","browsername":"androID","--session-overrIDe":"true","autoWebvIEw":"true","platformname":"AndroID","devicename":"ZY223ZMPG6"},"capabilitIEs":{"desiredCapabilitIEs":{"appActivity":"com.equationswork.enis.MainActivity","appPackage":"com.equationswork.enis","ChromedriverExecutable":"C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe","platformVersion":"7.0","autoGrantPermissions":"true","browsername":"androID","--session-overrIDe":"true","autoWebvIEw":"true","platformname":"AndroID","devicename":"ZY223ZMPG6"},"firstMatch":[{"--session-overrIDe":"true","appium:appActivity":"com.equati[deBUG] [MJsONWP] Calling AppiumDriver.createSession() with args: [{"appActivity":"com.equationswork.enis.MainActivity","appPackage":"com.equationswork.enis","ChromedriverExecutable":"C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe","platformVersion":"7.0","autoGrantPermissions":"true","browsername":"androID","--session-overrIDe":"true","autoWebvIEw":"true","platformname":"AndroID","devicename":"ZY223ZMPG6"},null,{"desiredCapabilitIEs":{"appActivity":"com.equationswork.enis.MainActivity","appPackage":"com.equationswork.enis","ChromedriverExecutable":"C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe","platformVersion":"7.0","autoGrantPermissions":"true","browsername":"androID","--session-overrIDe":"true","autoWebvIEw":"true","platformname":"AndroID","devicename":"ZY223ZMPG6"},"firstMatch":[{"--session-overrIDe":"true","appium:appActivity":"com.equationswork.enis.MainActivity","appium:appPackage":"com.e...[deBUG] [BaseDriver] Event 'newSessionRequested' logged at 1528700143344 (12:25:43 GMT+0530 (India Standard Time))[BaseDriver] The capabilitIEs ["--session-overrIDe"] are not standard capabilitIEs and should have an extension prefix[BaseDriver] Boolean capability passed in as string. Functionality may be compromised.[Appium] ConsIDer setting 'automationname' capability to 'uiautomator2' on AndroID >= 6, since UIautomator framework is not maintained anymore by the OS vendor.[Appium] Creating new AndroIDDriver (v2.4.1) session[Appium] CapabilitIEs:[Appium] --session-overrIDe: true[Appium] browsername: androID[Appium] platformname: androID[Appium] appActivity: com.equationswork.enis.MainActivity[Appium] appPackage: com.equationswork.enis[Appium] autoGrantPermissions: true[Appium] autoWebvIEw: true[Appium] ChromedriverExecutable: C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe[Appium] devicename: ZY223ZMPG6[Appium] platformVersion: 7.0[deBUG] [BaseDriver] W3C capabilitIEs {"alwaysMatch":{"appium:--s... and MJsONWP desired capabilitIEs [object Object] were provIDed[deBUG] [BaseDriver] Creating session with W3C capabilitIEs: {"alwaysMatch":{"appium:--s...[BaseDriver] Boolean capability passed in as string. Functionality may be compromised.[BaseDriver] Boolean capability passed in as string. Functionality may be compromised.[BaseDriver] Capability 'autoWebvIEw' changed from string to boolean. This may cause unexpected behavior[BaseDriver] Capability 'autoGrantPermissions' changed from string to boolean. This may cause unexpected behavior[BaseDriver] The following capabilitIEs were provIDed, but are not recognized by appium: --session-overrIDe.[BaseDriver] Session created with session ID: e5ce581e-243f-4a72-bc16-f2d84070f32b[deBUG] [AndroIDDriver] Getting Java version[AndroIDDriver] Java version is: 1.8.0_171[ADB] Checking whether adb is present[ADB] Found 1 'build-tools' folders under 'C:\Users\Anjani\AppData\Local\AndroID\sdk' (newest first):[ADB] C:/Users/Anjani/AppData/Local/AndroID/sdk/build-tools/23.0.3[ADB] Using adb.exe from C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe[AndroIDDriver] RetrIEving device List[deBUG] [ADB] Trying to find a connected androID device[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[AndroIDDriver] Looking for a device with AndroID '7.0'[deBUG] [ADB] Setting device ID to ZY223ZMPG6[ADB] Getting device platform version[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell getprop ro.build.version.release'[deBUG] [ADB] Current device property 'ro.build.version.release': 7.0[AndroIDDriver] Using device: ZY223ZMPG6[ADB] Checking whether adb is present[ADB] Using adb.exe from C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe[deBUG] [ADB] Setting device ID to ZY223ZMPG6[AndroIDDriver] App file was not Listed, instead we're going to run com.equationswork.enis directly on the device[deBUG] [AndroIDDriver] Checking whether package is present on the device[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell pm List packages com.equationswork.enis'[AndroIDDriver] Starting AndroID session[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 wait-for-device'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell echo Ping'[deBUG] [AndroIDDriver] Pushing settings apk to device...[deBUG] [ADB] Getting install status for io.appium.settings[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell pm List packages io.appium.settings'[deBUG] [ADB] App is installed[deBUG] [ADB] Getting package info for 'io.appium.settings'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell dumpsys package io.appium.settings'[ADB] Checking whether aapt is present[ADB] Using aapt.exe from C:\Users\Anjani\AppData\Local\AndroID\sdk\build-tools.0.3\aapt.exe[deBUG] [ADB] The installed 'io.appium.settings' package does not require upgrade ('2.3.0' >= '2.3.0')[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell ps'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell getprop ro.build.version.sdk'[deBUG] [ADB] Current device property 'ro.build.version.sdk': 24[deBUG] [ADB] Device API level: 24[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell am start -W -n io.appium.settings/.Settings -a androID.intent.action.MAIN -c androID.intent.category.LAUNCHER -f 0x10200000'[deBUG] [ADB] Device API level: 24[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell appops set io.appium.settings androID\:mock_location allow'[AndroIDDriver] setDeviceLanguageCountry requires language or country.[AndroIDDriver] Got language: 'null' and country: 'null'[deBUG] [Logcat] Starting logcat capture[deBUG] [AndroIDDriver] Pushing unlock helper app to device...[deBUG] [ADB] Getting install status for io.appium.unlock[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell pm List packages io.appium.unlock'[deBUG] [ADB] App is installed[deBUG] [ADB] Getting package info for 'io.appium.unlock'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell dumpsys package io.appium.unlock'[ADB] Checking whether aapt is present[ADB] Using aapt.exe from C:\Users\Anjani\AppData\Local\AndroID\sdk\build-tools.0.3\aapt.exe[deBUG] [ADB] The installed 'io.appium.unlock' package does not require upgrade ('2.0.0' >= '2.0.0')[ADB] Getting device platform version[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell getprop ro.build.version.release'[deBUG] [ADB] Current device property 'ro.build.version.release': 7.0[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell wm size'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell getprop ro.product.model'[deBUG] [ADB] Current device property 'ro.product.model': Moto G (5) Plus[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell getprop ro.product.manufacturer'[deBUG] [ADB] Current device property 'ro.product.manufacturer': motorola[AndroIDDriver] No app sent in, not parsing package/activity[deBUG] [AndroIDDriver] No app capability. Assuming it is already on the device[deBUG] [ADB] Getting install status for com.equationswork.enis[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell pm List packages com.equationswork.enis'[deBUG] [ADB] App is installed[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell am force-stop com.equationswork.enis'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell pm clear com.equationswork.enis'[deBUG] [ADB] Device API level: 24[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell dumpsys package com.equationswork.enis'[deBUG] [AndroIDDriver] Performed fast reset on the installed 'com.equationswork.enis' application (stop and clear)[deBUG] [AndroIDbootstrap] Watching for bootstrap disconnect[deBUG] [ADB] Forwarding system: 4724 to device: 4724[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 forward tcp\:4724 tcp\:4724'[deBUG] [Uiautomator] Starting Uiautomator[deBUG] [Uiautomator] Moving to state 'starting'[deBUG] [Uiautomator] Parsing uiautomator jar[deBUG] [Uiautomator] Found jar name: 'Appiumbootstrap.jar'[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 push C\:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-androID-bootstrap\bootstrap\bin\Appiumbootstrap.jar /data/local/tmp/'[deBUG] [ADB] Attempting to kill all uiautomator processes[deBUG] [ADB] Getting all processes with uiautomator[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell ps'[ADB] No uiautomator process found to kill, continuing...[deBUG] [Uiautomator] Starting UIautomator[deBUG] [ADB] Creating ADB subprocess with args: ["-P",5037,"-s","ZY223ZMPG6","shell","uiautomator","runtest","Appiumbootstrap.jar","-c","io.appium.androID.bootstrap.bootstrap","-e","pkg","com.equationswork.enis","-e","disableAndroIDWatchers",false,"-e","acceptSslCerts",false][deBUG] [Uiautomator] Moving to state 'online'[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Loading Json...[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Registered crash watchers.[AndroIDbootstrap] AndroID bootstrap socket is Now connected[deBUG] [ADB] Getting connected devices...[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] ClIEnt connected[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell dumpsys window'[AndroIDDriver] Screen already unlocked, doing nothing[deBUG] [ADB] Device API level: 24[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell am start -W -n com.equationswork.enis/com.equationswork.enis.MainActivity -S -a androID.intent.action.MAIN -c androID.intent.category.LAUNCHER -f 0x10200000'[AndroIDDriver] Setting auto webvIEw to context 'WEBVIEW_com.equationswork.enis' with timeout 2000ms[deBUG] [AndroIDDriver] Getting a List of available webvIEws[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell cat /proc/net/unix'[deBUG] [AndroIDDriver] Found webvIEws: ["WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Available contexts: ["NATIVE_APP","WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Getting a List of available webvIEws[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell cat /proc/net/unix'[deBUG] [AndroIDDriver] Found webvIEws: ["WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Available contexts: ["NATIVE_APP","WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Getting a List of available webvIEws[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell cat /proc/net/unix'[deBUG] [AndroIDDriver] Found webvIEws: ["WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Available contexts: ["NATIVE_APP","WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Getting a List of available webvIEws[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell cat /proc/net/unix'[deBUG] [AndroIDDriver] Found webvIEws: ["WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Available contexts: ["NATIVE_APP","WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Shutting down AndroID driver[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell am force-stop com.equationswork.enis'[deBUG] [ADB] Pressing the HOME button[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell input keyevent 3'[deBUG] [AndroIDbootstrap] Sending command to androID: {"cmd":"shutdown"}[deBUG] [AndroIDbootstrap] Received command result from bootstrap[deBUG] [Uiautomator] Shutting down Uiautomator[deBUG] [Uiautomator] Moving to state 'stopPing'[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Got data from clIEnt: {"cmd":"shutdown"}[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Got command of type SHUTDOWN[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Returning result: {"status":0,"value":"OK, shutting down"}[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Closed clIEnt connection[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: numtests=1[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: stream=.[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: ID=UiautomatorTestRunner[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: test=testRunServer[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: class=io.appium.androID.bootstrap.bootstrap[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: current=1[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS_CODE: 0[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: stream=[deBUG] [AndroIDbootstrap] [UIauto STDOUT] Test results for WatcherResultPrinter=.[deBUG] [AndroIDbootstrap] [UIauto STDOUT] Time: 5.426[deBUG] [AndroIDbootstrap] [UIauto STDOUT] OK (1 test)[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS_CODE: -1[deBUG] [Uiautomator] Uiautomator shut down normally[deBUG] [Uiautomator] Moving to state 'stopped'[deBUG] [ADB] Attempting to kill all uiautomator processes[deBUG] [ADB] Getting all processes with uiautomator[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell ps'[ADB] No uiautomator process found to kill, continuing...[deBUG] [Uiautomator] Moving to state 'stopped'[deBUG] [Logcat] StopPing logcat capture[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell am force-stop io.appium.unlock'[deBUG] [AndroIDDriver] Not cleaning generated files. Add `clearSystemfiles` capability if wanted.[deBUG] [BaseDriver] Event 'newSessionStarted' logged at 1528700164410 (12:26:04 GMT+0530 (India Standard Time))[http] <-- POST /wd/hub/session 400 21093 ms - 1026[http]

解决方法:

我希望你启动appium服务器,可能与用于初始化驱动程序对象的URL和端口相同.[+++]

总结

以上是内存溢出为你收集整理的android – 错误:无法创建新会话,因为找不到HttpClient,InputStream和long的’createSession’全部内容,希望文章能够帮你解决android – 错误:无法创建新会话,因为找不到HttpClient,InputStream和long的’createSession’所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 166, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
Error[8]: Undefined offset: 3, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

概述我试图自动化一个Android混合应用程序,但得到以下错误:1)Exceptioninthread“main”org.openqa.selenium.WebDriverException:Itisimpossibletocreateanewsessionbecause‘createSession’whichtakesHttpClient,InputStreamandlongwasnotfoundorit

我试图自动化一个Android混合应用程序,但得到以下错误:

1) Exception in thread “main” org.openqa.selenium.WebDriverException: It is impossible to create a new session because ‘createSession’ which takes httpClIEnt, inputStream and long was not found or it is not accessible

2) Caused by: java.lang.reflect.InvocationTargetException

3) Caused by: org.openqa.selenium.WebDriverException: No such context found.

4) NoSuchContextError: No such context found.

以下是我正在尝试执行的代码

package Demo;import java.net.MalformedURLException;import java.net.URL;import java.util.Set;import org.openqa.selenium.By;import org.openqa.selenium.remote.CapabilityType;import org.openqa.selenium.remote.DesiredCapabilitIEs;import io.appium.java_clIEnt.AppiumDriver;import io.appium.java_clIEnt.MobileElement;import io.appium.java_clIEnt.androID.AndroIDDriver;public class NewTest {private static AndroIDDriver<MobileElement> driver;public static voID main(String[] args) throws MalformedURLException, InterruptedException {DesiredCapabilitIEs capabilitIEs = new DesiredCapabilitIEs();capabilitIEs.setCapability(CapabilityType.broWSER_name, "androID");capabilitIEs.setCapability("devicename", "ZY223ZMPG6");capabilitIEs.setCapability("platformVersion", "7.0");capabilitIEs.setCapability("platformname", "AndroID");capabilitIEs.setCapability("autoGrantPermissions","true");capabilitIEs.setCapability("appPackage", "com.equationswork.enis");capabilitIEs.setCapability("appActivity", "com.equationswork.enis.MainActivity");capabilitIEs.setCapability("--session-overrIDe","true");capabilitIEs.setCapability("autoWebvIEw","true");capabilitIEs.setCapability("ChromedriverExecutable","C:\Users\Anjani \AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe");AppiumDriver<MobileElement> driver = new AndroIDDriver<MobileElement>(new  URL("http://0.0.0.0:4723/wd/hub"), capabilitIEs);        //driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);        Thread.sleep(5000);        //System.out.println(driver.getPageSource());Set<String> contextnames = driver.getContextHandles();for (String contextname : contextnames) { System.out.println(contextnames); //prints out something like   NATIVE_APP \n WEBVIEW_1        }driver.context((String) contextnames.toArray()[1]);driver.context("WEBVIEW_1");driver.findElement(By.ID("btnGuest")).click();//driver.quit();    }}Following are the errors thrown:Exception in thread "main" org.openqa.selenium.WebDriverException: It is impossible to create a new session because 'createSession' which takes httpClIEnt, inputStream and long was not found or it is not accessibleBuild info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z'System info: host: 'DESKtop-Lahp4RL', ip: '10.0.0.65', os.name: 'windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_171'Driver info: driver.version: AndroIDDriver    at io.appium.java_clIEnt.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:182)    at io.appium.java_clIEnt.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:196)    at io.appium.java_clIEnt.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:218)    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)    at io.appium.java_clIEnt.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)    at io.appium.java_clIEnt.AppiumDriver.execute(AppiumDriver.java:1)    at io.appium.java_clIEnt.androID.AndroIDDriver.execute(AndroIDDriver.java:1)    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:207)    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:130)    at io.appium.java_clIEnt.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:38)    at io.appium.java_clIEnt.AppiumDriver.<init>(AppiumDriver.java:84)    at io.appium.java_clIEnt.AppiumDriver.<init>(AppiumDriver.java:94)    at io.appium.java_clIEnt.androID.AndroIDDriver.<init>(AndroIDDriver.java:88)    at Demo.NewTest.main(NewTest.java:31)Caused by: java.lang.reflect.InvocationTargetException    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)    at sun.reflect.NativeMethodAccessorImpl.invoke(UnkNown Source)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(UnkNown Source)    at java.lang.reflect.Method.invoke(UnkNown Source)    at io.appium.java_clIEnt.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:172)    ... 13 moreCaused by: org.openqa.selenium.WebDriverException: No such context found.Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z'System info: host: 'DESKtop-Lahp4RL', ip: '10.0.0.65', os.name: 'windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_171'Driver info: driver.version: AndroIDDriverremote stacktrace: NoSuchContextError: No such context found.    at AndroIDDriver.callee
还有一件事,请使用string.contains(“WEBVIEW”)为每个循环再使用一个来切换上下文
$(C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-androID-driver\lib\commands\context.Js:49:11) at tryCatch (C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.Js:67:40) at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.Js:315:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.Js:100:21) at GeneratorFunctionPrototype.invoke (C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.Js:136:37) at <anonymous> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(UnkNown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(UnkNown Source) at java.lang.reflect.Constructor.newInstance(UnkNown Source) at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$new[+++](W3CHandshakeResponse.java:57) at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$getResponseFunction(W3CHandshakeResponse.java:104) at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession[+++](ProtocolHandshake.java:123) at java.util.stream.ReferencePipeline.accept(UnkNown Source) at java.util.Spliterators$ArraySpliterator.tryAdvance(UnkNown Source) at java.util.stream.ReferencePipeline.forEachWithCancel(UnkNown Source) at java.util.stream.AbstractPipeline.copyIntoWithCancel(UnkNown Source) at java.util.stream.AbstractPipeline.copyInto(UnkNown Source) at java.util.stream.AbstractPipeline.wrapAndcopyInto(UnkNown Source) at java.util.stream.FindOps$FindOp.evaluateSequential(UnkNown Source) at java.util.stream.AbstractPipeline.evaluate(UnkNown Source) at java.util.stream.ReferencePipeline.findFirst(UnkNown Source) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126) ... 18 moreFollowing is the selenium server log[Appium] Welcome to Appium v1.8.0[Appium] Appium REST http interface Listener started on 0.0.0.0:4723[http] --> POST /wd/hub/session[http] {"desiredCapabilitIEs":{"appActivity":"com.equationswork.enis.MainActivity","appPackage":"com.equationswork.enis","ChromedriverExecutable":"C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe","platformVersion":"7.0","autoGrantPermissions":"true","browsername":"androID","--session-overrIDe":"true","autoWebvIEw":"true","platformname":"AndroID","devicename":"ZY223ZMPG6"},"capabilitIEs":{"desiredCapabilitIEs":{"appActivity":"com.equationswork.enis.MainActivity","appPackage":"com.equationswork.enis","ChromedriverExecutable":"C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe","platformVersion":"7.0","autoGrantPermissions":"true","browsername":"androID","--session-overrIDe":"true","autoWebvIEw":"true","platformname":"AndroID","devicename":"ZY223ZMPG6"},"firstMatch":[{"--session-overrIDe":"true","appium:appActivity":"com.equati[deBUG] [MJsONWP] Calling AppiumDriver.createSession() with args: [{"appActivity":"com.equationswork.enis.MainActivity","appPackage":"com.equationswork.enis","ChromedriverExecutable":"C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe","platformVersion":"7.0","autoGrantPermissions":"true","browsername":"androID","--session-overrIDe":"true","autoWebvIEw":"true","platformname":"AndroID","devicename":"ZY223ZMPG6"},null,{"desiredCapabilitIEs":{"appActivity":"com.equationswork.enis.MainActivity","appPackage":"com.equationswork.enis","ChromedriverExecutable":"C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe","platformVersion":"7.0","autoGrantPermissions":"true","browsername":"androID","--session-overrIDe":"true","autoWebvIEw":"true","platformname":"AndroID","devicename":"ZY223ZMPG6"},"firstMatch":[{"--session-overrIDe":"true","appium:appActivity":"com.equationswork.enis.MainActivity","appium:appPackage":"com.e...[deBUG] [BaseDriver] Event 'newSessionRequested' logged at 1528700143344 (12:25:43 GMT+0530 (India Standard Time))[BaseDriver] The capabilitIEs ["--session-overrIDe"] are not standard capabilitIEs and should have an extension prefix[BaseDriver] Boolean capability passed in as string. Functionality may be compromised.[Appium] ConsIDer setting 'automationname' capability to 'uiautomator2' on AndroID >= 6, since UIautomator framework is not maintained anymore by the OS vendor.[Appium] Creating new AndroIDDriver (v2.4.1) session[Appium] CapabilitIEs:[Appium] --session-overrIDe: true[Appium] browsername: androID[Appium] platformname: androID[Appium] appActivity: com.equationswork.enis.MainActivity[Appium] appPackage: com.equationswork.enis[Appium] autoGrantPermissions: true[Appium] autoWebvIEw: true[Appium] ChromedriverExecutable: C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe[Appium] devicename: ZY223ZMPG6[Appium] platformVersion: 7.0[deBUG] [BaseDriver] W3C capabilitIEs {"alwaysMatch":{"appium:--s... and MJsONWP desired capabilitIEs [object Object] were provIDed[deBUG] [BaseDriver] Creating session with W3C capabilitIEs: {"alwaysMatch":{"appium:--s...[BaseDriver] Boolean capability passed in as string. Functionality may be compromised.[BaseDriver] Boolean capability passed in as string. Functionality may be compromised.[BaseDriver] Capability 'autoWebvIEw' changed from string to boolean. This may cause unexpected behavior[BaseDriver] Capability 'autoGrantPermissions' changed from string to boolean. This may cause unexpected behavior[BaseDriver] The following capabilitIEs were provIDed, but are not recognized by appium: --session-overrIDe.[BaseDriver] Session created with session ID: e5ce581e-243f-4a72-bc16-f2d84070f32b[deBUG] [AndroIDDriver] Getting Java version[AndroIDDriver] Java version is: 1.8.0_171[ADB] Checking whether adb is present[ADB] Found 1 'build-tools' folders under 'C:\Users\Anjani\AppData\Local\AndroID\sdk' (newest first):[ADB] C:/Users/Anjani/AppData/Local/AndroID/sdk/build-tools/23.0.3[ADB] Using adb.exe from C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe[AndroIDDriver] RetrIEving device List[deBUG] [ADB] Trying to find a connected androID device[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[AndroIDDriver] Looking for a device with AndroID '7.0'[deBUG] [ADB] Setting device ID to ZY223ZMPG6[ADB] Getting device platform version[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell getprop ro.build.version.release'[deBUG] [ADB] Current device property 'ro.build.version.release': 7.0[AndroIDDriver] Using device: ZY223ZMPG6[ADB] Checking whether adb is present[ADB] Using adb.exe from C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe[deBUG] [ADB] Setting device ID to ZY223ZMPG6[AndroIDDriver] App file was not Listed, instead we're going to run com.equationswork.enis directly on the device[deBUG] [AndroIDDriver] Checking whether package is present on the device[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell pm List packages com.equationswork.enis'[AndroIDDriver] Starting AndroID session[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 wait-for-device'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell echo Ping'[deBUG] [AndroIDDriver] Pushing settings apk to device...[deBUG] [ADB] Getting install status for io.appium.settings[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell pm List packages io.appium.settings'[deBUG] [ADB] App is installed[deBUG] [ADB] Getting package info for 'io.appium.settings'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell dumpsys package io.appium.settings'[ADB] Checking whether aapt is present[ADB] Using aapt.exe from C:\Users\Anjani\AppData\Local\AndroID\sdk\build-tools.0.3\aapt.exe[deBUG] [ADB] The installed 'io.appium.settings' package does not require upgrade ('2.3.0' >= '2.3.0')[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell ps'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell getprop ro.build.version.sdk'[deBUG] [ADB] Current device property 'ro.build.version.sdk': 24[deBUG] [ADB] Device API level: 24[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell am start -W -n io.appium.settings/.Settings -a androID.intent.action.MAIN -c androID.intent.category.LAUNCHER -f 0x10200000'[deBUG] [ADB] Device API level: 24[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell appops set io.appium.settings androID\:mock_location allow'[AndroIDDriver] setDeviceLanguageCountry requires language or country.[AndroIDDriver] Got language: 'null' and country: 'null'[deBUG] [Logcat] Starting logcat capture[deBUG] [AndroIDDriver] Pushing unlock helper app to device...[deBUG] [ADB] Getting install status for io.appium.unlock[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell pm List packages io.appium.unlock'[deBUG] [ADB] App is installed[deBUG] [ADB] Getting package info for 'io.appium.unlock'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell dumpsys package io.appium.unlock'[ADB] Checking whether aapt is present[ADB] Using aapt.exe from C:\Users\Anjani\AppData\Local\AndroID\sdk\build-tools.0.3\aapt.exe[deBUG] [ADB] The installed 'io.appium.unlock' package does not require upgrade ('2.0.0' >= '2.0.0')[ADB] Getting device platform version[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell getprop ro.build.version.release'[deBUG] [ADB] Current device property 'ro.build.version.release': 7.0[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell wm size'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell getprop ro.product.model'[deBUG] [ADB] Current device property 'ro.product.model': Moto G (5) Plus[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell getprop ro.product.manufacturer'[deBUG] [ADB] Current device property 'ro.product.manufacturer': motorola[AndroIDDriver] No app sent in, not parsing package/activity[deBUG] [AndroIDDriver] No app capability. Assuming it is already on the device[deBUG] [ADB] Getting install status for com.equationswork.enis[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell pm List packages com.equationswork.enis'[deBUG] [ADB] App is installed[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell am force-stop com.equationswork.enis'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell pm clear com.equationswork.enis'[deBUG] [ADB] Device API level: 24[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell dumpsys package com.equationswork.enis'[deBUG] [AndroIDDriver] Performed fast reset on the installed 'com.equationswork.enis' application (stop and clear)[deBUG] [AndroIDbootstrap] Watching for bootstrap disconnect[deBUG] [ADB] Forwarding system: 4724 to device: 4724[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 forward tcp\:4724 tcp\:4724'[deBUG] [Uiautomator] Starting Uiautomator[deBUG] [Uiautomator] Moving to state 'starting'[deBUG] [Uiautomator] Parsing uiautomator jar[deBUG] [Uiautomator] Found jar name: 'Appiumbootstrap.jar'[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 push C\:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-androID-bootstrap\bootstrap\bin\Appiumbootstrap.jar /data/local/tmp/'[deBUG] [ADB] Attempting to kill all uiautomator processes[deBUG] [ADB] Getting all processes with uiautomator[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell ps'[ADB] No uiautomator process found to kill, continuing...[deBUG] [Uiautomator] Starting UIautomator[deBUG] [ADB] Creating ADB subprocess with args: ["-P",5037,"-s","ZY223ZMPG6","shell","uiautomator","runtest","Appiumbootstrap.jar","-c","io.appium.androID.bootstrap.bootstrap","-e","pkg","com.equationswork.enis","-e","disableAndroIDWatchers",false,"-e","acceptSslCerts",false][deBUG] [Uiautomator] Moving to state 'online'[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Loading Json...[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Registered crash watchers.[AndroIDbootstrap] AndroID bootstrap socket is Now connected[deBUG] [ADB] Getting connected devices...[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] ClIEnt connected[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell dumpsys window'[AndroIDDriver] Screen already unlocked, doing nothing[deBUG] [ADB] Device API level: 24[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell am start -W -n com.equationswork.enis/com.equationswork.enis.MainActivity -S -a androID.intent.action.MAIN -c androID.intent.category.LAUNCHER -f 0x10200000'[AndroIDDriver] Setting auto webvIEw to context 'WEBVIEW_com.equationswork.enis' with timeout 2000ms[deBUG] [AndroIDDriver] Getting a List of available webvIEws[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell cat /proc/net/unix'[deBUG] [AndroIDDriver] Found webvIEws: ["WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Available contexts: ["NATIVE_APP","WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Getting a List of available webvIEws[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell cat /proc/net/unix'[deBUG] [AndroIDDriver] Found webvIEws: ["WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Available contexts: ["NATIVE_APP","WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Getting a List of available webvIEws[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell cat /proc/net/unix'[deBUG] [AndroIDDriver] Found webvIEws: ["WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Available contexts: ["NATIVE_APP","WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Getting a List of available webvIEws[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell cat /proc/net/unix'[deBUG] [AndroIDDriver] Found webvIEws: ["WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Available contexts: ["NATIVE_APP","WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Shutting down AndroID driver[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell am force-stop com.equationswork.enis'[deBUG] [ADB] Pressing the HOME button[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell input keyevent 3'[deBUG] [AndroIDbootstrap] Sending command to androID: {"cmd":"shutdown"}[deBUG] [AndroIDbootstrap] Received command result from bootstrap[deBUG] [Uiautomator] Shutting down Uiautomator[deBUG] [Uiautomator] Moving to state 'stopPing'[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Got data from clIEnt: {"cmd":"shutdown"}[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Got command of type SHUTDOWN[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Returning result: {"status":0,"value":"OK, shutting down"}[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Closed clIEnt connection[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: numtests=1[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: stream=.[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: ID=UiautomatorTestRunner[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: test=testRunServer[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: class=io.appium.androID.bootstrap.bootstrap[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: current=1[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS_CODE: 0[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: stream=[deBUG] [AndroIDbootstrap] [UIauto STDOUT] Test results for WatcherResultPrinter=.[deBUG] [AndroIDbootstrap] [UIauto STDOUT] Time: 5.426[deBUG] [AndroIDbootstrap] [UIauto STDOUT] OK (1 test)[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS_CODE: -1[deBUG] [Uiautomator] Uiautomator shut down normally[deBUG] [Uiautomator] Moving to state 'stopped'[deBUG] [ADB] Attempting to kill all uiautomator processes[deBUG] [ADB] Getting all processes with uiautomator[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell ps'[ADB] No uiautomator process found to kill, continuing...[deBUG] [Uiautomator] Moving to state 'stopped'[deBUG] [Logcat] StopPing logcat capture[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell am force-stop io.appium.unlock'[deBUG] [AndroIDDriver] Not cleaning generated files. Add `clearSystemfiles` capability if wanted.[deBUG] [BaseDriver] Event 'newSessionStarted' logged at 1528700164410 (12:26:04 GMT+0530 (India Standard Time))[http] <-- POST /wd/hub/session 400 21093 ms - 1026[http]

解决方法:

我希望你启动appium服务器,可能与用于初始化驱动程序对象的URL和端口相同.[+++]

总结

以上是内存溢出为你收集整理的android – 错误:无法创建新会话,因为找不到HttpClient,InputStream和long的’createSession’全部内容,希望文章能够帮你解决android – 错误:无法创建新会话,因为找不到HttpClient,InputStream和long的’createSession’所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 166, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
Error[8]: Undefined offset: 4, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

概述我试图自动化一个Android混合应用程序,但得到以下错误:1)Exceptioninthread“main”org.openqa.selenium.WebDriverException:Itisimpossibletocreateanewsessionbecause‘createSession’whichtakesHttpClient,InputStreamandlongwasnotfoundorit

我试图自动化一个Android混合应用程序,但得到以下错误:

1) Exception in thread “main” org.openqa.selenium.WebDriverException: It is impossible to create a new session because ‘createSession’ which takes httpClIEnt, inputStream and long was not found or it is not accessible

2) Caused by: java.lang.reflect.InvocationTargetException

3) Caused by: org.openqa.selenium.WebDriverException: No such context found.

4) NoSuchContextError: No such context found.

以下是我正在尝试执行的代码

package Demo;import java.net.MalformedURLException;import java.net.URL;import java.util.Set;import org.openqa.selenium.By;import org.openqa.selenium.remote.CapabilityType;import org.openqa.selenium.remote.DesiredCapabilitIEs;import io.appium.java_clIEnt.AppiumDriver;import io.appium.java_clIEnt.MobileElement;import io.appium.java_clIEnt.androID.AndroIDDriver;public class NewTest {private static AndroIDDriver<MobileElement> driver;public static voID main(String[] args) throws MalformedURLException, InterruptedException {DesiredCapabilitIEs capabilitIEs = new DesiredCapabilitIEs();capabilitIEs.setCapability(CapabilityType.broWSER_name, "androID");capabilitIEs.setCapability("devicename", "ZY223ZMPG6");capabilitIEs.setCapability("platformVersion", "7.0");capabilitIEs.setCapability("platformname", "AndroID");capabilitIEs.setCapability("autoGrantPermissions","true");capabilitIEs.setCapability("appPackage", "com.equationswork.enis");capabilitIEs.setCapability("appActivity", "com.equationswork.enis.MainActivity");capabilitIEs.setCapability("--session-overrIDe","true");capabilitIEs.setCapability("autoWebvIEw","true");capabilitIEs.setCapability("ChromedriverExecutable","C:\Users\Anjani \AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe");AppiumDriver<MobileElement> driver = new AndroIDDriver<MobileElement>(new  URL("http://0.0.0.0:4723/wd/hub"), capabilitIEs);        //driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);        Thread.sleep(5000);        //System.out.println(driver.getPageSource());Set<String> contextnames = driver.getContextHandles();for (String contextname : contextnames) { System.out.println(contextnames); //prints out something like   NATIVE_APP \n WEBVIEW_1        }driver.context((String) contextnames.toArray()[1]);driver.context("WEBVIEW_1");driver.findElement(By.ID("btnGuest")).click();//driver.quit();    }}Following are the errors thrown:Exception in thread "main" org.openqa.selenium.WebDriverException: It is impossible to create a new session because 'createSession' which takes httpClIEnt, inputStream and long was not found or it is not accessibleBuild info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z'System info: host: 'DESKtop-Lahp4RL', ip: '10.0.0.65', os.name: 'windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_171'Driver info: driver.version: AndroIDDriver    at io.appium.java_clIEnt.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:182)    at io.appium.java_clIEnt.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:196)    at io.appium.java_clIEnt.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:218)    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)    at io.appium.java_clIEnt.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)    at io.appium.java_clIEnt.AppiumDriver.execute(AppiumDriver.java:1)    at io.appium.java_clIEnt.androID.AndroIDDriver.execute(AndroIDDriver.java:1)    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:207)    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:130)    at io.appium.java_clIEnt.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:38)    at io.appium.java_clIEnt.AppiumDriver.<init>(AppiumDriver.java:84)    at io.appium.java_clIEnt.AppiumDriver.<init>(AppiumDriver.java:94)    at io.appium.java_clIEnt.androID.AndroIDDriver.<init>(AndroIDDriver.java:88)    at Demo.NewTest.main(NewTest.java:31)Caused by: java.lang.reflect.InvocationTargetException    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)    at sun.reflect.NativeMethodAccessorImpl.invoke(UnkNown Source)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(UnkNown Source)    at java.lang.reflect.Method.invoke(UnkNown Source)    at io.appium.java_clIEnt.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:172)    ... 13 moreCaused by: org.openqa.selenium.WebDriverException: No such context found.Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z'System info: host: 'DESKtop-Lahp4RL', ip: '10.0.0.65', os.name: 'windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_171'Driver info: driver.version: AndroIDDriverremote stacktrace: NoSuchContextError: No such context found.    at AndroIDDriver.callee
还有一件事,请使用string.contains(“WEBVIEW”)为每个循环再使用一个来切换上下文
$(C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-androID-driver\lib\commands\context.Js:49:11) at tryCatch (C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.Js:67:40) at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.Js:315:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.Js:100:21) at GeneratorFunctionPrototype.invoke (C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.Js:136:37) at <anonymous> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(UnkNown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(UnkNown Source) at java.lang.reflect.Constructor.newInstance(UnkNown Source) at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$new(W3CHandshakeResponse.java:57) at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$getResponseFunction(W3CHandshakeResponse.java:104) at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession[+++](ProtocolHandshake.java:123) at java.util.stream.ReferencePipeline.accept(UnkNown Source) at java.util.Spliterators$ArraySpliterator.tryAdvance(UnkNown Source) at java.util.stream.ReferencePipeline.forEachWithCancel(UnkNown Source) at java.util.stream.AbstractPipeline.copyIntoWithCancel(UnkNown Source) at java.util.stream.AbstractPipeline.copyInto(UnkNown Source) at java.util.stream.AbstractPipeline.wrapAndcopyInto(UnkNown Source) at java.util.stream.FindOps$FindOp.evaluateSequential(UnkNown Source) at java.util.stream.AbstractPipeline.evaluate(UnkNown Source) at java.util.stream.ReferencePipeline.findFirst(UnkNown Source) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126) ... 18 moreFollowing is the selenium server log[Appium] Welcome to Appium v1.8.0[Appium] Appium REST http interface Listener started on 0.0.0.0:4723[http] --> POST /wd/hub/session[http] {"desiredCapabilitIEs":{"appActivity":"com.equationswork.enis.MainActivity","appPackage":"com.equationswork.enis","ChromedriverExecutable":"C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe","platformVersion":"7.0","autoGrantPermissions":"true","browsername":"androID","--session-overrIDe":"true","autoWebvIEw":"true","platformname":"AndroID","devicename":"ZY223ZMPG6"},"capabilitIEs":{"desiredCapabilitIEs":{"appActivity":"com.equationswork.enis.MainActivity","appPackage":"com.equationswork.enis","ChromedriverExecutable":"C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe","platformVersion":"7.0","autoGrantPermissions":"true","browsername":"androID","--session-overrIDe":"true","autoWebvIEw":"true","platformname":"AndroID","devicename":"ZY223ZMPG6"},"firstMatch":[{"--session-overrIDe":"true","appium:appActivity":"com.equati[deBUG] [MJsONWP] Calling AppiumDriver.createSession() with args: [{"appActivity":"com.equationswork.enis.MainActivity","appPackage":"com.equationswork.enis","ChromedriverExecutable":"C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe","platformVersion":"7.0","autoGrantPermissions":"true","browsername":"androID","--session-overrIDe":"true","autoWebvIEw":"true","platformname":"AndroID","devicename":"ZY223ZMPG6"},null,{"desiredCapabilitIEs":{"appActivity":"com.equationswork.enis.MainActivity","appPackage":"com.equationswork.enis","ChromedriverExecutable":"C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe","platformVersion":"7.0","autoGrantPermissions":"true","browsername":"androID","--session-overrIDe":"true","autoWebvIEw":"true","platformname":"AndroID","devicename":"ZY223ZMPG6"},"firstMatch":[{"--session-overrIDe":"true","appium:appActivity":"com.equationswork.enis.MainActivity","appium:appPackage":"com.e...[deBUG] [BaseDriver] Event 'newSessionRequested' logged at 1528700143344 (12:25:43 GMT+0530 (India Standard Time))[BaseDriver] The capabilitIEs ["--session-overrIDe"] are not standard capabilitIEs and should have an extension prefix[BaseDriver] Boolean capability passed in as string. Functionality may be compromised.[Appium] ConsIDer setting 'automationname' capability to 'uiautomator2' on AndroID >= 6, since UIautomator framework is not maintained anymore by the OS vendor.[Appium] Creating new AndroIDDriver (v2.4.1) session[Appium] CapabilitIEs:[Appium] --session-overrIDe: true[Appium] browsername: androID[Appium] platformname: androID[Appium] appActivity: com.equationswork.enis.MainActivity[Appium] appPackage: com.equationswork.enis[Appium] autoGrantPermissions: true[Appium] autoWebvIEw: true[Appium] ChromedriverExecutable: C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe[Appium] devicename: ZY223ZMPG6[Appium] platformVersion: 7.0[deBUG] [BaseDriver] W3C capabilitIEs {"alwaysMatch":{"appium:--s... and MJsONWP desired capabilitIEs [object Object] were provIDed[deBUG] [BaseDriver] Creating session with W3C capabilitIEs: {"alwaysMatch":{"appium:--s...[BaseDriver] Boolean capability passed in as string. Functionality may be compromised.[BaseDriver] Boolean capability passed in as string. Functionality may be compromised.[BaseDriver] Capability 'autoWebvIEw' changed from string to boolean. This may cause unexpected behavior[BaseDriver] Capability 'autoGrantPermissions' changed from string to boolean. This may cause unexpected behavior[BaseDriver] The following capabilitIEs were provIDed, but are not recognized by appium: --session-overrIDe.[BaseDriver] Session created with session ID: e5ce581e-243f-4a72-bc16-f2d84070f32b[deBUG] [AndroIDDriver] Getting Java version[AndroIDDriver] Java version is: 1.8.0_171[ADB] Checking whether adb is present[ADB] Found 1 'build-tools' folders under 'C:\Users\Anjani\AppData\Local\AndroID\sdk' (newest first):[ADB] C:/Users/Anjani/AppData/Local/AndroID/sdk/build-tools/23.0.3[ADB] Using adb.exe from C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe[AndroIDDriver] RetrIEving device List[deBUG] [ADB] Trying to find a connected androID device[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[AndroIDDriver] Looking for a device with AndroID '7.0'[deBUG] [ADB] Setting device ID to ZY223ZMPG6[ADB] Getting device platform version[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell getprop ro.build.version.release'[deBUG] [ADB] Current device property 'ro.build.version.release': 7.0[AndroIDDriver] Using device: ZY223ZMPG6[ADB] Checking whether adb is present[ADB] Using adb.exe from C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe[deBUG] [ADB] Setting device ID to ZY223ZMPG6[AndroIDDriver] App file was not Listed, instead we're going to run com.equationswork.enis directly on the device[deBUG] [AndroIDDriver] Checking whether package is present on the device[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell pm List packages com.equationswork.enis'[AndroIDDriver] Starting AndroID session[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 wait-for-device'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell echo Ping'[deBUG] [AndroIDDriver] Pushing settings apk to device...[deBUG] [ADB] Getting install status for io.appium.settings[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell pm List packages io.appium.settings'[deBUG] [ADB] App is installed[deBUG] [ADB] Getting package info for 'io.appium.settings'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell dumpsys package io.appium.settings'[ADB] Checking whether aapt is present[ADB] Using aapt.exe from C:\Users\Anjani\AppData\Local\AndroID\sdk\build-tools.0.3\aapt.exe[deBUG] [ADB] The installed 'io.appium.settings' package does not require upgrade ('2.3.0' >= '2.3.0')[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell ps'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell getprop ro.build.version.sdk'[deBUG] [ADB] Current device property 'ro.build.version.sdk': 24[deBUG] [ADB] Device API level: 24[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell am start -W -n io.appium.settings/.Settings -a androID.intent.action.MAIN -c androID.intent.category.LAUNCHER -f 0x10200000'[deBUG] [ADB] Device API level: 24[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell appops set io.appium.settings androID\:mock_location allow'[AndroIDDriver] setDeviceLanguageCountry requires language or country.[AndroIDDriver] Got language: 'null' and country: 'null'[deBUG] [Logcat] Starting logcat capture[deBUG] [AndroIDDriver] Pushing unlock helper app to device...[deBUG] [ADB] Getting install status for io.appium.unlock[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell pm List packages io.appium.unlock'[deBUG] [ADB] App is installed[deBUG] [ADB] Getting package info for 'io.appium.unlock'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell dumpsys package io.appium.unlock'[ADB] Checking whether aapt is present[ADB] Using aapt.exe from C:\Users\Anjani\AppData\Local\AndroID\sdk\build-tools.0.3\aapt.exe[deBUG] [ADB] The installed 'io.appium.unlock' package does not require upgrade ('2.0.0' >= '2.0.0')[ADB] Getting device platform version[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell getprop ro.build.version.release'[deBUG] [ADB] Current device property 'ro.build.version.release': 7.0[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell wm size'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell getprop ro.product.model'[deBUG] [ADB] Current device property 'ro.product.model': Moto G (5) Plus[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell getprop ro.product.manufacturer'[deBUG] [ADB] Current device property 'ro.product.manufacturer': motorola[AndroIDDriver] No app sent in, not parsing package/activity[deBUG] [AndroIDDriver] No app capability. Assuming it is already on the device[deBUG] [ADB] Getting install status for com.equationswork.enis[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell pm List packages com.equationswork.enis'[deBUG] [ADB] App is installed[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell am force-stop com.equationswork.enis'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell pm clear com.equationswork.enis'[deBUG] [ADB] Device API level: 24[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell dumpsys package com.equationswork.enis'[deBUG] [AndroIDDriver] Performed fast reset on the installed 'com.equationswork.enis' application (stop and clear)[deBUG] [AndroIDbootstrap] Watching for bootstrap disconnect[deBUG] [ADB] Forwarding system: 4724 to device: 4724[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 forward tcp\:4724 tcp\:4724'[deBUG] [Uiautomator] Starting Uiautomator[deBUG] [Uiautomator] Moving to state 'starting'[deBUG] [Uiautomator] Parsing uiautomator jar[deBUG] [Uiautomator] Found jar name: 'Appiumbootstrap.jar'[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 push C\:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-androID-bootstrap\bootstrap\bin\Appiumbootstrap.jar /data/local/tmp/'[deBUG] [ADB] Attempting to kill all uiautomator processes[deBUG] [ADB] Getting all processes with uiautomator[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell ps'[ADB] No uiautomator process found to kill, continuing...[deBUG] [Uiautomator] Starting UIautomator[deBUG] [ADB] Creating ADB subprocess with args: ["-P",5037,"-s","ZY223ZMPG6","shell","uiautomator","runtest","Appiumbootstrap.jar","-c","io.appium.androID.bootstrap.bootstrap","-e","pkg","com.equationswork.enis","-e","disableAndroIDWatchers",false,"-e","acceptSslCerts",false][deBUG] [Uiautomator] Moving to state 'online'[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Loading Json...[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Registered crash watchers.[AndroIDbootstrap] AndroID bootstrap socket is Now connected[deBUG] [ADB] Getting connected devices...[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] ClIEnt connected[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell dumpsys window'[AndroIDDriver] Screen already unlocked, doing nothing[deBUG] [ADB] Device API level: 24[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell am start -W -n com.equationswork.enis/com.equationswork.enis.MainActivity -S -a androID.intent.action.MAIN -c androID.intent.category.LAUNCHER -f 0x10200000'[AndroIDDriver] Setting auto webvIEw to context 'WEBVIEW_com.equationswork.enis' with timeout 2000ms[deBUG] [AndroIDDriver] Getting a List of available webvIEws[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell cat /proc/net/unix'[deBUG] [AndroIDDriver] Found webvIEws: ["WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Available contexts: ["NATIVE_APP","WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Getting a List of available webvIEws[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell cat /proc/net/unix'[deBUG] [AndroIDDriver] Found webvIEws: ["WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Available contexts: ["NATIVE_APP","WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Getting a List of available webvIEws[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell cat /proc/net/unix'[deBUG] [AndroIDDriver] Found webvIEws: ["WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Available contexts: ["NATIVE_APP","WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Getting a List of available webvIEws[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell cat /proc/net/unix'[deBUG] [AndroIDDriver] Found webvIEws: ["WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Available contexts: ["NATIVE_APP","WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Shutting down AndroID driver[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell am force-stop com.equationswork.enis'[deBUG] [ADB] Pressing the HOME button[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell input keyevent 3'[deBUG] [AndroIDbootstrap] Sending command to androID: {"cmd":"shutdown"}[deBUG] [AndroIDbootstrap] Received command result from bootstrap[deBUG] [Uiautomator] Shutting down Uiautomator[deBUG] [Uiautomator] Moving to state 'stopPing'[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Got data from clIEnt: {"cmd":"shutdown"}[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Got command of type SHUTDOWN[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Returning result: {"status":0,"value":"OK, shutting down"}[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Closed clIEnt connection[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: numtests=1[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: stream=.[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: ID=UiautomatorTestRunner[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: test=testRunServer[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: class=io.appium.androID.bootstrap.bootstrap[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: current=1[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS_CODE: 0[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: stream=[deBUG] [AndroIDbootstrap] [UIauto STDOUT] Test results for WatcherResultPrinter=.[deBUG] [AndroIDbootstrap] [UIauto STDOUT] Time: 5.426[deBUG] [AndroIDbootstrap] [UIauto STDOUT] OK (1 test)[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS_CODE: -1[deBUG] [Uiautomator] Uiautomator shut down normally[deBUG] [Uiautomator] Moving to state 'stopped'[deBUG] [ADB] Attempting to kill all uiautomator processes[deBUG] [ADB] Getting all processes with uiautomator[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell ps'[ADB] No uiautomator process found to kill, continuing...[deBUG] [Uiautomator] Moving to state 'stopped'[deBUG] [Logcat] StopPing logcat capture[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell am force-stop io.appium.unlock'[deBUG] [AndroIDDriver] Not cleaning generated files. Add `clearSystemfiles` capability if wanted.[deBUG] [BaseDriver] Event 'newSessionStarted' logged at 1528700164410 (12:26:04 GMT+0530 (India Standard Time))[http] <-- POST /wd/hub/session 400 21093 ms - 1026[http]

解决方法:

我希望你启动appium服务器,可能与用于初始化驱动程序对象的URL和端口相同.[+++]

总结

以上是内存溢出为你收集整理的android – 错误:无法创建新会话,因为找不到HttpClient,InputStream和long的’createSession’全部内容,希望文章能够帮你解决android – 错误:无法创建新会话,因为找不到HttpClient,InputStream和long的’createSession’所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 166, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
Error[8]: Undefined offset: 5, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

概述我试图自动化一个Android混合应用程序,但得到以下错误:1)Exceptioninthread“main”org.openqa.selenium.WebDriverException:Itisimpossibletocreateanewsessionbecause‘createSession’whichtakesHttpClient,InputStreamandlongwasnotfoundorit

我试图自动化一个Android混合应用程序,但得到以下错误:

1) Exception in thread “main” org.openqa.selenium.WebDriverException: It is impossible to create a new session because ‘createSession’ which takes httpClIEnt, inputStream and long was not found or it is not accessible

2) Caused by: java.lang.reflect.InvocationTargetException

3) Caused by: org.openqa.selenium.WebDriverException: No such context found.

4) NoSuchContextError: No such context found.

以下是我正在尝试执行的代码

package Demo;import java.net.MalformedURLException;import java.net.URL;import java.util.Set;import org.openqa.selenium.By;import org.openqa.selenium.remote.CapabilityType;import org.openqa.selenium.remote.DesiredCapabilitIEs;import io.appium.java_clIEnt.AppiumDriver;import io.appium.java_clIEnt.MobileElement;import io.appium.java_clIEnt.androID.AndroIDDriver;public class NewTest {private static AndroIDDriver<MobileElement> driver;public static voID main(String[] args) throws MalformedURLException, InterruptedException {DesiredCapabilitIEs capabilitIEs = new DesiredCapabilitIEs();capabilitIEs.setCapability(CapabilityType.broWSER_name, "androID");capabilitIEs.setCapability("devicename", "ZY223ZMPG6");capabilitIEs.setCapability("platformVersion", "7.0");capabilitIEs.setCapability("platformname", "AndroID");capabilitIEs.setCapability("autoGrantPermissions","true");capabilitIEs.setCapability("appPackage", "com.equationswork.enis");capabilitIEs.setCapability("appActivity", "com.equationswork.enis.MainActivity");capabilitIEs.setCapability("--session-overrIDe","true");capabilitIEs.setCapability("autoWebvIEw","true");capabilitIEs.setCapability("ChromedriverExecutable","C:\Users\Anjani \AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe");AppiumDriver<MobileElement> driver = new AndroIDDriver<MobileElement>(new  URL("http://0.0.0.0:4723/wd/hub"), capabilitIEs);        //driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);        Thread.sleep(5000);        //System.out.println(driver.getPageSource());Set<String> contextnames = driver.getContextHandles();for (String contextname : contextnames) { System.out.println(contextnames); //prints out something like   NATIVE_APP \n WEBVIEW_1        }driver.context((String) contextnames.toArray()[1]);driver.context("WEBVIEW_1");driver.findElement(By.ID("btnGuest")).click();//driver.quit();    }}Following are the errors thrown:Exception in thread "main" org.openqa.selenium.WebDriverException: It is impossible to create a new session because 'createSession' which takes httpClIEnt, inputStream and long was not found or it is not accessibleBuild info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z'System info: host: 'DESKtop-Lahp4RL', ip: '10.0.0.65', os.name: 'windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_171'Driver info: driver.version: AndroIDDriver    at io.appium.java_clIEnt.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:182)    at io.appium.java_clIEnt.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:196)    at io.appium.java_clIEnt.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:218)    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)    at io.appium.java_clIEnt.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)    at io.appium.java_clIEnt.AppiumDriver.execute(AppiumDriver.java:1)    at io.appium.java_clIEnt.androID.AndroIDDriver.execute(AndroIDDriver.java:1)    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:207)    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:130)    at io.appium.java_clIEnt.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:38)    at io.appium.java_clIEnt.AppiumDriver.<init>(AppiumDriver.java:84)    at io.appium.java_clIEnt.AppiumDriver.<init>(AppiumDriver.java:94)    at io.appium.java_clIEnt.androID.AndroIDDriver.<init>(AndroIDDriver.java:88)    at Demo.NewTest.main(NewTest.java:31)Caused by: java.lang.reflect.InvocationTargetException    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)    at sun.reflect.NativeMethodAccessorImpl.invoke(UnkNown Source)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(UnkNown Source)    at java.lang.reflect.Method.invoke(UnkNown Source)    at io.appium.java_clIEnt.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:172)    ... 13 moreCaused by: org.openqa.selenium.WebDriverException: No such context found.Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z'System info: host: 'DESKtop-Lahp4RL', ip: '10.0.0.65', os.name: 'windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_171'Driver info: driver.version: AndroIDDriverremote stacktrace: NoSuchContextError: No such context found.    at AndroIDDriver.callee
还有一件事,请使用string.contains(“WEBVIEW”)为每个循环再使用一个来切换上下文
$(C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-androID-driver\lib\commands\context.Js:49:11) at tryCatch (C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.Js:67:40) at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.Js:315:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.Js:100:21) at GeneratorFunctionPrototype.invoke (C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.Js:136:37) at <anonymous> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(UnkNown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(UnkNown Source) at java.lang.reflect.Constructor.newInstance(UnkNown Source) at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$new(W3CHandshakeResponse.java:57) at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$getResponseFunction(W3CHandshakeResponse.java:104) at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession(ProtocolHandshake.java:123) at java.util.stream.ReferencePipeline.accept(UnkNown Source) at java.util.Spliterators$ArraySpliterator.tryAdvance(UnkNown Source) at java.util.stream.ReferencePipeline.forEachWithCancel(UnkNown Source) at java.util.stream.AbstractPipeline.copyIntoWithCancel(UnkNown Source) at java.util.stream.AbstractPipeline.copyInto(UnkNown Source) at java.util.stream.AbstractPipeline.wrapAndcopyInto(UnkNown Source) at java.util.stream.FindOps$FindOp.evaluateSequential(UnkNown Source) at java.util.stream.AbstractPipeline.evaluate(UnkNown Source) at java.util.stream.ReferencePipeline.findFirst(UnkNown Source) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126) ... 18 moreFollowing is the selenium server log[Appium] Welcome to Appium v1.8.0[Appium] Appium REST http interface Listener started on 0.0.0.0:4723[http] --> POST /wd/hub/session[http] {"desiredCapabilitIEs":{"appActivity":"com.equationswork.enis.MainActivity","appPackage":"com.equationswork.enis","ChromedriverExecutable":"C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe","platformVersion":"7.0","autoGrantPermissions":"true","browsername":"androID","--session-overrIDe":"true","autoWebvIEw":"true","platformname":"AndroID","devicename":"ZY223ZMPG6"},"capabilitIEs":{"desiredCapabilitIEs":{"appActivity":"com.equationswork.enis.MainActivity","appPackage":"com.equationswork.enis","ChromedriverExecutable":"C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe","platformVersion":"7.0","autoGrantPermissions":"true","browsername":"androID","--session-overrIDe":"true","autoWebvIEw":"true","platformname":"AndroID","devicename":"ZY223ZMPG6"},"firstMatch":[{"--session-overrIDe":"true","appium:appActivity":"com.equati[deBUG] [MJsONWP] Calling AppiumDriver.createSession() with args: [{"appActivity":"com.equationswork.enis.MainActivity","appPackage":"com.equationswork.enis","ChromedriverExecutable":"C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe","platformVersion":"7.0","autoGrantPermissions":"true","browsername":"androID","--session-overrIDe":"true","autoWebvIEw":"true","platformname":"AndroID","devicename":"ZY223ZMPG6"},null,{"desiredCapabilitIEs":{"appActivity":"com.equationswork.enis.MainActivity","appPackage":"com.equationswork.enis","ChromedriverExecutable":"C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe","platformVersion":"7.0","autoGrantPermissions":"true","browsername":"androID","--session-overrIDe":"true","autoWebvIEw":"true","platformname":"AndroID","devicename":"ZY223ZMPG6"},"firstMatch":[{"--session-overrIDe":"true","appium:appActivity":"com.equationswork.enis.MainActivity","appium:appPackage":"com.e...[deBUG] [BaseDriver] Event 'newSessionRequested' logged at 1528700143344 (12:25:43 GMT+0530 (India Standard Time))[BaseDriver] The capabilitIEs ["--session-overrIDe"] are not standard capabilitIEs and should have an extension prefix[BaseDriver] Boolean capability passed in as string. Functionality may be compromised.[Appium] ConsIDer setting 'automationname' capability to 'uiautomator2' on AndroID >= 6, since UIautomator framework is not maintained anymore by the OS vendor.[Appium] Creating new AndroIDDriver (v2.4.1) session[Appium] CapabilitIEs:[Appium] --session-overrIDe: true[Appium] browsername: androID[Appium] platformname: androID[Appium] appActivity: com.equationswork.enis.MainActivity[Appium] appPackage: com.equationswork.enis[Appium] autoGrantPermissions: true[Appium] autoWebvIEw: true[Appium] ChromedriverExecutable: C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe[Appium] devicename: ZY223ZMPG6[Appium] platformVersion: 7.0[deBUG] [BaseDriver] W3C capabilitIEs {"alwaysMatch":{"appium:--s... and MJsONWP desired capabilitIEs [object Object] were provIDed[deBUG] [BaseDriver] Creating session with W3C capabilitIEs: {"alwaysMatch":{"appium:--s...[BaseDriver] Boolean capability passed in as string. Functionality may be compromised.[BaseDriver] Boolean capability passed in as string. Functionality may be compromised.[BaseDriver] Capability 'autoWebvIEw' changed from string to boolean. This may cause unexpected behavior[BaseDriver] Capability 'autoGrantPermissions' changed from string to boolean. This may cause unexpected behavior[BaseDriver] The following capabilitIEs were provIDed, but are not recognized by appium: --session-overrIDe.[BaseDriver] Session created with session ID: e5ce581e-243f-4a72-bc16-f2d84070f32b[deBUG] [AndroIDDriver] Getting Java version[AndroIDDriver] Java version is: 1.8.0_171[ADB] Checking whether adb is present[ADB] Found 1 'build-tools' folders under 'C:\Users\Anjani\AppData\Local\AndroID\sdk' (newest first):[ADB] C:/Users/Anjani/AppData/Local/AndroID/sdk/build-tools/23.0.3[ADB] Using adb.exe from C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe[AndroIDDriver] RetrIEving device List[deBUG] [ADB] Trying to find a connected androID device[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[AndroIDDriver] Looking for a device with AndroID '7.0'[deBUG] [ADB] Setting device ID to ZY223ZMPG6[ADB] Getting device platform version[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell getprop ro.build.version.release'[deBUG] [ADB] Current device property 'ro.build.version.release': 7.0[AndroIDDriver] Using device: ZY223ZMPG6[ADB] Checking whether adb is present[ADB] Using adb.exe from C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe[deBUG] [ADB] Setting device ID to ZY223ZMPG6[AndroIDDriver] App file was not Listed, instead we're going to run com.equationswork.enis directly on the device[deBUG] [AndroIDDriver] Checking whether package is present on the device[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell pm List packages com.equationswork.enis'[AndroIDDriver] Starting AndroID session[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 wait-for-device'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell echo Ping'[deBUG] [AndroIDDriver] Pushing settings apk to device...[deBUG] [ADB] Getting install status for io.appium.settings[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell pm List packages io.appium.settings'[deBUG] [ADB] App is installed[deBUG] [ADB] Getting package info for 'io.appium.settings'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell dumpsys package io.appium.settings'[ADB] Checking whether aapt is present[ADB] Using aapt.exe from C:\Users\Anjani\AppData\Local\AndroID\sdk\build-tools.0.3\aapt.exe[deBUG] [ADB] The installed 'io.appium.settings' package does not require upgrade ('2.3.0' >= '2.3.0')[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell ps'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell getprop ro.build.version.sdk'[deBUG] [ADB] Current device property 'ro.build.version.sdk': 24[deBUG] [ADB] Device API level: 24[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell am start -W -n io.appium.settings/.Settings -a androID.intent.action.MAIN -c androID.intent.category.LAUNCHER -f 0x10200000'[deBUG] [ADB] Device API level: 24[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell appops set io.appium.settings androID\:mock_location allow'[AndroIDDriver] setDeviceLanguageCountry requires language or country.[AndroIDDriver] Got language: 'null' and country: 'null'[deBUG] [Logcat] Starting logcat capture[deBUG] [AndroIDDriver] Pushing unlock helper app to device...[deBUG] [ADB] Getting install status for io.appium.unlock[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell pm List packages io.appium.unlock'[deBUG] [ADB] App is installed[deBUG] [ADB] Getting package info for 'io.appium.unlock'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell dumpsys package io.appium.unlock'[ADB] Checking whether aapt is present[ADB] Using aapt.exe from C:\Users\Anjani\AppData\Local\AndroID\sdk\build-tools.0.3\aapt.exe[deBUG] [ADB] The installed 'io.appium.unlock' package does not require upgrade ('2.0.0' >= '2.0.0')[ADB] Getting device platform version[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell getprop ro.build.version.release'[deBUG] [ADB] Current device property 'ro.build.version.release': 7.0[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell wm size'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell getprop ro.product.model'[deBUG] [ADB] Current device property 'ro.product.model': Moto G (5) Plus[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell getprop ro.product.manufacturer'[deBUG] [ADB] Current device property 'ro.product.manufacturer': motorola[AndroIDDriver] No app sent in, not parsing package/activity[deBUG] [AndroIDDriver] No app capability. Assuming it is already on the device[deBUG] [ADB] Getting install status for com.equationswork.enis[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell pm List packages com.equationswork.enis'[deBUG] [ADB] App is installed[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell am force-stop com.equationswork.enis'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell pm clear com.equationswork.enis'[deBUG] [ADB] Device API level: 24[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell dumpsys package com.equationswork.enis'[deBUG] [AndroIDDriver] Performed fast reset on the installed 'com.equationswork.enis' application (stop and clear)[deBUG] [AndroIDbootstrap] Watching for bootstrap disconnect[deBUG] [ADB] Forwarding system: 4724 to device: 4724[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 forward tcp\:4724 tcp\:4724'[deBUG] [Uiautomator] Starting Uiautomator[deBUG] [Uiautomator] Moving to state 'starting'[deBUG] [Uiautomator] Parsing uiautomator jar[deBUG] [Uiautomator] Found jar name: 'Appiumbootstrap.jar'[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 push C\:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-androID-bootstrap\bootstrap\bin\Appiumbootstrap.jar /data/local/tmp/'[deBUG] [ADB] Attempting to kill all uiautomator processes[deBUG] [ADB] Getting all processes with uiautomator[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell ps'[ADB] No uiautomator process found to kill, continuing...[deBUG] [Uiautomator] Starting UIautomator[deBUG] [ADB] Creating ADB subprocess with args: ["-P",5037,"-s","ZY223ZMPG6","shell","uiautomator","runtest","Appiumbootstrap.jar","-c","io.appium.androID.bootstrap.bootstrap","-e","pkg","com.equationswork.enis","-e","disableAndroIDWatchers",false,"-e","acceptSslCerts",false][deBUG] [Uiautomator] Moving to state 'online'[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Loading Json...[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Registered crash watchers.[AndroIDbootstrap] AndroID bootstrap socket is Now connected[deBUG] [ADB] Getting connected devices...[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] ClIEnt connected[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell dumpsys window'[AndroIDDriver] Screen already unlocked, doing nothing[deBUG] [ADB] Device API level: 24[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell am start -W -n com.equationswork.enis/com.equationswork.enis.MainActivity -S -a androID.intent.action.MAIN -c androID.intent.category.LAUNCHER -f 0x10200000'[AndroIDDriver] Setting auto webvIEw to context 'WEBVIEW_com.equationswork.enis' with timeout 2000ms[deBUG] [AndroIDDriver] Getting a List of available webvIEws[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell cat /proc/net/unix'[deBUG] [AndroIDDriver] Found webvIEws: ["WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Available contexts: ["NATIVE_APP","WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Getting a List of available webvIEws[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell cat /proc/net/unix'[deBUG] [AndroIDDriver] Found webvIEws: ["WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Available contexts: ["NATIVE_APP","WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Getting a List of available webvIEws[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell cat /proc/net/unix'[deBUG] [AndroIDDriver] Found webvIEws: ["WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Available contexts: ["NATIVE_APP","WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Getting a List of available webvIEws[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell cat /proc/net/unix'[deBUG] [AndroIDDriver] Found webvIEws: ["WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Available contexts: ["NATIVE_APP","WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Shutting down AndroID driver[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell am force-stop com.equationswork.enis'[deBUG] [ADB] Pressing the HOME button[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell input keyevent 3'[deBUG] [AndroIDbootstrap] Sending command to androID: {"cmd":"shutdown"}[deBUG] [AndroIDbootstrap] Received command result from bootstrap[deBUG] [Uiautomator] Shutting down Uiautomator[deBUG] [Uiautomator] Moving to state 'stopPing'[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Got data from clIEnt: {"cmd":"shutdown"}[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Got command of type SHUTDOWN[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Returning result: {"status":0,"value":"OK, shutting down"}[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Closed clIEnt connection[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: numtests=1[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: stream=.[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: ID=UiautomatorTestRunner[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: test=testRunServer[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: class=io.appium.androID.bootstrap.bootstrap[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: current=1[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS_CODE: 0[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: stream=[deBUG] [AndroIDbootstrap] [UIauto STDOUT] Test results for WatcherResultPrinter=.[deBUG] [AndroIDbootstrap] [UIauto STDOUT] Time: 5.426[deBUG] [AndroIDbootstrap] [UIauto STDOUT] OK (1 test)[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS_CODE: -1[deBUG] [Uiautomator] Uiautomator shut down normally[deBUG] [Uiautomator] Moving to state 'stopped'[deBUG] [ADB] Attempting to kill all uiautomator processes[deBUG] [ADB] Getting all processes with uiautomator[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell ps'[ADB] No uiautomator process found to kill, continuing...[deBUG] [Uiautomator] Moving to state 'stopped'[deBUG] [Logcat] StopPing logcat capture[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell am force-stop io.appium.unlock'[deBUG] [AndroIDDriver] Not cleaning generated files. Add `clearSystemfiles` capability if wanted.[deBUG] [BaseDriver] Event 'newSessionStarted' logged at 1528700164410 (12:26:04 GMT+0530 (India Standard Time))[http] <-- POST /wd/hub/session 400 21093 ms - 1026[http]

解决方法:

我希望你启动appium服务器,可能与用于初始化驱动程序对象的URL和端口相同.[+++]

总结

以上是内存溢出为你收集整理的android – 错误:无法创建新会话,因为找不到HttpClient,InputStream和long的’createSession’全部内容,希望文章能够帮你解决android – 错误:无法创建新会话,因为找不到HttpClient,InputStream和long的’createSession’所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 166, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
android– 错误:无法创建新会话,因为找不到HttpClient,InputStream和long的’createSession’_app_内存溢出

android– 错误:无法创建新会话,因为找不到HttpClient,InputStream和long的’createSession’

android– 错误:无法创建新会话,因为找不到HttpClient,InputStream和long的’createSession’,第1张

概述我试图自动化一个Android混合应用程序,但得到以下错误:1)Exceptioninthread“main”org.openqa.selenium.WebDriverException:Itisimpossibletocreateanewsessionbecause‘createSession’whichtakesHttpClient,InputStreamandlongwasnotfoundorit

我试图自动化一个Android混合应用程序,但得到以下错误:

1) Exception in thread “main” org.openqa.selenium.WebDriverException: It is impossible to create a new session because ‘createSession’ which takes httpClIEnt, inputStream and long was not found or it is not accessible

2) Caused by: java.lang.reflect.InvocationTargetException

3) Caused by: org.openqa.selenium.WebDriverException: No such context found.

4) NoSuchContextError: No such context found.

以下是我正在尝试执行的代码

package Demo;import java.net.MalformedURLException;import java.net.URL;import java.util.Set;import org.openqa.selenium.By;import org.openqa.selenium.remote.CapabilityType;import org.openqa.selenium.remote.DesiredCapabilitIEs;import io.appium.java_clIEnt.AppiumDriver;import io.appium.java_clIEnt.MobileElement;import io.appium.java_clIEnt.androID.AndroIDDriver;public class NewTest {private static AndroIDDriver<MobileElement> driver;public static voID main(String[] args) throws MalformedURLException, InterruptedException {DesiredCapabilitIEs capabilitIEs = new DesiredCapabilitIEs();capabilitIEs.setCapability(CapabilityType.broWSER_name, "androID");capabilitIEs.setCapability("devicename", "ZY223ZMPG6");capabilitIEs.setCapability("platformVersion", "7.0");capabilitIEs.setCapability("platformname", "AndroID");capabilitIEs.setCapability("autoGrantPermissions","true");capabilitIEs.setCapability("appPackage", "com.equationswork.enis");capabilitIEs.setCapability("appActivity", "com.equationswork.enis.MainActivity");capabilitIEs.setCapability("--session-overrIDe","true");capabilitIEs.setCapability("autoWebvIEw","true");capabilitIEs.setCapability("ChromedriverExecutable","C:\Users\Anjani \AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe");AppiumDriver<MobileElement> driver = new AndroIDDriver<MobileElement>(new  URL("http://0.0.0.0:4723/wd/hub"), capabilitIEs);        //driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);        Thread.sleep(5000);        //System.out.println(driver.getPageSource());Set<String> contextnames = driver.getContextHandles();for (String contextname : contextnames) { System.out.println(contextnames); //prints out something like   NATIVE_APP \n WEBVIEW_1        }driver.context((String) contextnames.toArray()[1]);driver.context("WEBVIEW_1");driver.findElement(By.ID("btnGuest")).click();//driver.quit();    }}Following are the errors thrown:Exception in thread "main" org.openqa.selenium.WebDriverException: It is impossible to create a new session because 'createSession' which takes httpClIEnt, inputStream and long was not found or it is not accessibleBuild info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z'System info: host: 'DESKtop-Lahp4RL', ip: '10.0.0.65', os.name: 'windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_171'Driver info: driver.version: AndroIDDriver    at io.appium.java_clIEnt.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:182)    at io.appium.java_clIEnt.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:196)    at io.appium.java_clIEnt.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:218)    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)    at io.appium.java_clIEnt.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)    at io.appium.java_clIEnt.AppiumDriver.execute(AppiumDriver.java:1)    at io.appium.java_clIEnt.androID.AndroIDDriver.execute(AndroIDDriver.java:1)    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:207)    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:130)    at io.appium.java_clIEnt.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:38)    at io.appium.java_clIEnt.AppiumDriver.<init>(AppiumDriver.java:84)    at io.appium.java_clIEnt.AppiumDriver.<init>(AppiumDriver.java:94)    at io.appium.java_clIEnt.androID.AndroIDDriver.<init>(AndroIDDriver.java:88)    at Demo.NewTest.main(NewTest.java:31)Caused by: java.lang.reflect.InvocationTargetException    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)    at sun.reflect.NativeMethodAccessorImpl.invoke(UnkNown Source)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(UnkNown Source)    at java.lang.reflect.Method.invoke(UnkNown Source)    at io.appium.java_clIEnt.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:172)    ... 13 moreCaused by: org.openqa.selenium.WebDriverException: No such context found.Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z'System info: host: 'DESKtop-Lahp4RL', ip: '10.0.0.65', os.name: 'windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_171'Driver info: driver.version: AndroIDDriverremote stacktrace: NoSuchContextError: No such context found.    at AndroIDDriver.callee
还有一件事,请使用string.contains(“WEBVIEW”)为每个循环再使用一个来切换上下文
$(C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-androID-driver\lib\commands\context.Js:49:11) at tryCatch (C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.Js:67:40) at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.Js:315:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.Js:100:21) at GeneratorFunctionPrototype.invoke (C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.Js:136:37) at <anonymous> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(UnkNown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(UnkNown Source) at java.lang.reflect.Constructor.newInstance(UnkNown Source) at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$new(W3CHandshakeResponse.java:57) at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$getResponseFunction(W3CHandshakeResponse.java:104) at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession(ProtocolHandshake.java:123) at java.util.stream.ReferencePipeline.accept(UnkNown Source) at java.util.Spliterators$ArraySpliterator.tryAdvance(UnkNown Source) at java.util.stream.ReferencePipeline.forEachWithCancel(UnkNown Source) at java.util.stream.AbstractPipeline.copyIntoWithCancel(UnkNown Source) at java.util.stream.AbstractPipeline.copyInto(UnkNown Source) at java.util.stream.AbstractPipeline.wrapAndcopyInto(UnkNown Source) at java.util.stream.FindOps$FindOp.evaluateSequential(UnkNown Source) at java.util.stream.AbstractPipeline.evaluate(UnkNown Source) at java.util.stream.ReferencePipeline.findFirst(UnkNown Source) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126) ... 18 moreFollowing is the selenium server log[Appium] Welcome to Appium v1.8.0[Appium] Appium REST http interface Listener started on 0.0.0.0:4723[http] --> POST /wd/hub/session[http] {"desiredCapabilitIEs":{"appActivity":"com.equationswork.enis.MainActivity","appPackage":"com.equationswork.enis","ChromedriverExecutable":"C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe","platformVersion":"7.0","autoGrantPermissions":"true","browsername":"androID","--session-overrIDe":"true","autoWebvIEw":"true","platformname":"AndroID","devicename":"ZY223ZMPG6"},"capabilitIEs":{"desiredCapabilitIEs":{"appActivity":"com.equationswork.enis.MainActivity","appPackage":"com.equationswork.enis","ChromedriverExecutable":"C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe","platformVersion":"7.0","autoGrantPermissions":"true","browsername":"androID","--session-overrIDe":"true","autoWebvIEw":"true","platformname":"AndroID","devicename":"ZY223ZMPG6"},"firstMatch":[{"--session-overrIDe":"true","appium:appActivity":"com.equati[deBUG] [MJsONWP] Calling AppiumDriver.createSession() with args: [{"appActivity":"com.equationswork.enis.MainActivity","appPackage":"com.equationswork.enis","ChromedriverExecutable":"C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe","platformVersion":"7.0","autoGrantPermissions":"true","browsername":"androID","--session-overrIDe":"true","autoWebvIEw":"true","platformname":"AndroID","devicename":"ZY223ZMPG6"},null,{"desiredCapabilitIEs":{"appActivity":"com.equationswork.enis.MainActivity","appPackage":"com.equationswork.enis","ChromedriverExecutable":"C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe","platformVersion":"7.0","autoGrantPermissions":"true","browsername":"androID","--session-overrIDe":"true","autoWebvIEw":"true","platformname":"AndroID","devicename":"ZY223ZMPG6"},"firstMatch":[{"--session-overrIDe":"true","appium:appActivity":"com.equationswork.enis.MainActivity","appium:appPackage":"com.e...[deBUG] [BaseDriver] Event 'newSessionRequested' logged at 1528700143344 (12:25:43 GMT+0530 (India Standard Time))[BaseDriver] The capabilitIEs ["--session-overrIDe"] are not standard capabilitIEs and should have an extension prefix[BaseDriver] Boolean capability passed in as string. Functionality may be compromised.[Appium] ConsIDer setting 'automationname' capability to 'uiautomator2' on AndroID >= 6, since UIautomator framework is not maintained anymore by the OS vendor.[Appium] Creating new AndroIDDriver (v2.4.1) session[Appium] CapabilitIEs:[Appium] --session-overrIDe: true[Appium] browsername: androID[Appium] platformname: androID[Appium] appActivity: com.equationswork.enis.MainActivity[Appium] appPackage: com.equationswork.enis[Appium] autoGrantPermissions: true[Appium] autoWebvIEw: true[Appium] ChromedriverExecutable: C:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-Chromedriver\Chromedriver\win\chromedriver.exe[Appium] devicename: ZY223ZMPG6[Appium] platformVersion: 7.0[deBUG] [BaseDriver] W3C capabilitIEs {"alwaysMatch":{"appium:--s... and MJsONWP desired capabilitIEs [object Object] were provIDed[deBUG] [BaseDriver] Creating session with W3C capabilitIEs: {"alwaysMatch":{"appium:--s...[BaseDriver] Boolean capability passed in as string. Functionality may be compromised.[BaseDriver] Boolean capability passed in as string. Functionality may be compromised.[BaseDriver] Capability 'autoWebvIEw' changed from string to boolean. This may cause unexpected behavior[BaseDriver] Capability 'autoGrantPermissions' changed from string to boolean. This may cause unexpected behavior[BaseDriver] The following capabilitIEs were provIDed, but are not recognized by appium: --session-overrIDe.[BaseDriver] Session created with session ID: e5ce581e-243f-4a72-bc16-f2d84070f32b[deBUG] [AndroIDDriver] Getting Java version[AndroIDDriver] Java version is: 1.8.0_171[ADB] Checking whether adb is present[ADB] Found 1 'build-tools' folders under 'C:\Users\Anjani\AppData\Local\AndroID\sdk' (newest first):[ADB] C:/Users/Anjani/AppData/Local/AndroID/sdk/build-tools/23.0.3[ADB] Using adb.exe from C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe[AndroIDDriver] RetrIEving device List[deBUG] [ADB] Trying to find a connected androID device[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[AndroIDDriver] Looking for a device with AndroID '7.0'[deBUG] [ADB] Setting device ID to ZY223ZMPG6[ADB] Getting device platform version[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell getprop ro.build.version.release'[deBUG] [ADB] Current device property 'ro.build.version.release': 7.0[AndroIDDriver] Using device: ZY223ZMPG6[ADB] Checking whether adb is present[ADB] Using adb.exe from C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe[deBUG] [ADB] Setting device ID to ZY223ZMPG6[AndroIDDriver] App file was not Listed, instead we're going to run com.equationswork.enis directly on the device[deBUG] [AndroIDDriver] Checking whether package is present on the device[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell pm List packages com.equationswork.enis'[AndroIDDriver] Starting AndroID session[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 wait-for-device'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell echo Ping'[deBUG] [AndroIDDriver] Pushing settings apk to device...[deBUG] [ADB] Getting install status for io.appium.settings[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell pm List packages io.appium.settings'[deBUG] [ADB] App is installed[deBUG] [ADB] Getting package info for 'io.appium.settings'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell dumpsys package io.appium.settings'[ADB] Checking whether aapt is present[ADB] Using aapt.exe from C:\Users\Anjani\AppData\Local\AndroID\sdk\build-tools.0.3\aapt.exe[deBUG] [ADB] The installed 'io.appium.settings' package does not require upgrade ('2.3.0' >= '2.3.0')[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell ps'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell getprop ro.build.version.sdk'[deBUG] [ADB] Current device property 'ro.build.version.sdk': 24[deBUG] [ADB] Device API level: 24[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell am start -W -n io.appium.settings/.Settings -a androID.intent.action.MAIN -c androID.intent.category.LAUNCHER -f 0x10200000'[deBUG] [ADB] Device API level: 24[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell appops set io.appium.settings androID\:mock_location allow'[AndroIDDriver] setDeviceLanguageCountry requires language or country.[AndroIDDriver] Got language: 'null' and country: 'null'[deBUG] [Logcat] Starting logcat capture[deBUG] [AndroIDDriver] Pushing unlock helper app to device...[deBUG] [ADB] Getting install status for io.appium.unlock[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell pm List packages io.appium.unlock'[deBUG] [ADB] App is installed[deBUG] [ADB] Getting package info for 'io.appium.unlock'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell dumpsys package io.appium.unlock'[ADB] Checking whether aapt is present[ADB] Using aapt.exe from C:\Users\Anjani\AppData\Local\AndroID\sdk\build-tools.0.3\aapt.exe[deBUG] [ADB] The installed 'io.appium.unlock' package does not require upgrade ('2.0.0' >= '2.0.0')[ADB] Getting device platform version[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell getprop ro.build.version.release'[deBUG] [ADB] Current device property 'ro.build.version.release': 7.0[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell wm size'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell getprop ro.product.model'[deBUG] [ADB] Current device property 'ro.product.model': Moto G (5) Plus[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell getprop ro.product.manufacturer'[deBUG] [ADB] Current device property 'ro.product.manufacturer': motorola[AndroIDDriver] No app sent in, not parsing package/activity[deBUG] [AndroIDDriver] No app capability. Assuming it is already on the device[deBUG] [ADB] Getting install status for com.equationswork.enis[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell pm List packages com.equationswork.enis'[deBUG] [ADB] App is installed[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell am force-stop com.equationswork.enis'[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell pm clear com.equationswork.enis'[deBUG] [ADB] Device API level: 24[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell dumpsys package com.equationswork.enis'[deBUG] [AndroIDDriver] Performed fast reset on the installed 'com.equationswork.enis' application (stop and clear)[deBUG] [AndroIDbootstrap] Watching for bootstrap disconnect[deBUG] [ADB] Forwarding system: 4724 to device: 4724[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 forward tcp\:4724 tcp\:4724'[deBUG] [Uiautomator] Starting Uiautomator[deBUG] [Uiautomator] Moving to state 'starting'[deBUG] [Uiautomator] Parsing uiautomator jar[deBUG] [Uiautomator] Found jar name: 'Appiumbootstrap.jar'[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 push C\:\Users\Anjani\AppData\Roaming\npm\node_modules\appium\node_modules\appium-androID-bootstrap\bootstrap\bin\Appiumbootstrap.jar /data/local/tmp/'[deBUG] [ADB] Attempting to kill all uiautomator processes[deBUG] [ADB] Getting all processes with uiautomator[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell ps'[ADB] No uiautomator process found to kill, continuing...[deBUG] [Uiautomator] Starting UIautomator[deBUG] [ADB] Creating ADB subprocess with args: ["-P",5037,"-s","ZY223ZMPG6","shell","uiautomator","runtest","Appiumbootstrap.jar","-c","io.appium.androID.bootstrap.bootstrap","-e","pkg","com.equationswork.enis","-e","disableAndroIDWatchers",false,"-e","acceptSslCerts",false][deBUG] [Uiautomator] Moving to state 'online'[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Loading Json...[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Registered crash watchers.[AndroIDbootstrap] AndroID bootstrap socket is Now connected[deBUG] [ADB] Getting connected devices...[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] ClIEnt connected[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell dumpsys window'[AndroIDDriver] Screen already unlocked, doing nothing[deBUG] [ADB] Device API level: 24[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell am start -W -n com.equationswork.enis/com.equationswork.enis.MainActivity -S -a androID.intent.action.MAIN -c androID.intent.category.LAUNCHER -f 0x10200000'[AndroIDDriver] Setting auto webvIEw to context 'WEBVIEW_com.equationswork.enis' with timeout 2000ms[deBUG] [AndroIDDriver] Getting a List of available webvIEws[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell cat /proc/net/unix'[deBUG] [AndroIDDriver] Found webvIEws: ["WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Available contexts: ["NATIVE_APP","WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Getting a List of available webvIEws[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell cat /proc/net/unix'[deBUG] [AndroIDDriver] Found webvIEws: ["WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Available contexts: ["NATIVE_APP","WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Getting a List of available webvIEws[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell cat /proc/net/unix'[deBUG] [AndroIDDriver] Found webvIEws: ["WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Available contexts: ["NATIVE_APP","WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Getting a List of available webvIEws[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell cat /proc/net/unix'[deBUG] [AndroIDDriver] Found webvIEws: ["WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Available contexts: ["NATIVE_APP","WEBVIEW_Chrome"][deBUG] [AndroIDDriver] Shutting down AndroID driver[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell am force-stop com.equationswork.enis'[deBUG] [ADB] Pressing the HOME button[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell input keyevent 3'[deBUG] [AndroIDbootstrap] Sending command to androID: {"cmd":"shutdown"}[deBUG] [AndroIDbootstrap] Received command result from bootstrap[deBUG] [Uiautomator] Shutting down Uiautomator[deBUG] [Uiautomator] Moving to state 'stopPing'[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Got data from clIEnt: {"cmd":"shutdown"}[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Got command of type SHUTDOWN[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Returning result: {"status":0,"value":"OK, shutting down"}[deBUG] [AndroIDbootstrap] [bootstrap LOG] [deBUG] Closed clIEnt connection[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: numtests=1[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: stream=.[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: ID=UiautomatorTestRunner[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: test=testRunServer[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: class=io.appium.androID.bootstrap.bootstrap[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: current=1[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS_CODE: 0[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS: stream=[deBUG] [AndroIDbootstrap] [UIauto STDOUT] Test results for WatcherResultPrinter=.[deBUG] [AndroIDbootstrap] [UIauto STDOUT] Time: 5.426[deBUG] [AndroIDbootstrap] [UIauto STDOUT] OK (1 test)[deBUG] [AndroIDbootstrap] [UIauto STDOUT] INSTRUMENTATION_STATUS_CODE: -1[deBUG] [Uiautomator] Uiautomator shut down normally[deBUG] [Uiautomator] Moving to state 'stopped'[deBUG] [ADB] Attempting to kill all uiautomator processes[deBUG] [ADB] Getting all processes with uiautomator[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell ps'[ADB] No uiautomator process found to kill, continuing...[deBUG] [Uiautomator] Moving to state 'stopped'[deBUG] [Logcat] StopPing logcat capture[deBUG] [ADB] Getting connected devices...[deBUG] [ADB] 1 device(s) connected[deBUG] [ADB] Running 'C:\Users\Anjani\AppData\Local\AndroID\sdk\platform-tools\adb.exe -P 5037 -s ZY223ZMPG6 shell am force-stop io.appium.unlock'[deBUG] [AndroIDDriver] Not cleaning generated files. Add `clearSystemfiles` capability if wanted.[deBUG] [BaseDriver] Event 'newSessionStarted' logged at 1528700164410 (12:26:04 GMT+0530 (India Standard Time))[http] <-- POST /wd/hub/session 400 21093 ms - 1026[http]

解决方法:

我希望你启动appium服务器,可能与用于初始化驱动程序对象的URL和端口相同.

总结

以上是内存溢出为你收集整理的android – 错误:无法创建新会话,因为找不到HttpClient,InputStream和long的’createSession’全部内容,希望文章能够帮你解决android – 错误:无法创建新会话,因为找不到HttpClient,InputStream和long的’createSession’所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1104729.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-28
下一篇 2022-05-28

发表评论

登录后才能评论

评论列表(0条)

保存