请教各位大侠,我测微信小程序的时候,切换 webview 报错
基本设置:
ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("androidProcess", "com.tencent.mm:appbrand0");
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
当代码执行到这里就报错了:
driver.context("WEBVIEW_com.tencent.mm:tools");
控制台日志:
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: session not created exception: please close '' and try again
(Driver info: chromedriver=2.24.417431 (9aea000394714d2fbb20850021f6204f2256b9cf),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 4.98 seconds
Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:00:58'
System info: host: 'YK-DZ-4711702', ip: '172.168.16.110', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_121'
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities [{appPackage=com.tencent.mm, noReset=true, deviceName=05157df5a207d11f, fullReset=false, platform=LINUX, deviceUDID=05157df5a207d11f, desired={appPackage=com.tencent.mm, noReset=true, deviceName=05157df5a207d11f, fullReset=false, appActivity=.ui.LauncherUI, platformVersion=6.0.1, browserName=, fastReset=false, unicodeKeyboard=true, chromeOptions={args=[], extensions=[], androidProcess=com.tencent.mm:appbrand0}, udid=05157df5a207d11f, platformName=Android, resetKeyboard=true}, platformVersion=6.0.1, webStorageEnabled=false, takesScreenshot=true, browserName=, javascriptEnabled=true, unicodeKeyboard=true, udid=05157df5a207d11f, platformName=Android, deviceManufacturer=samsung, resetKeyboard=true, deviceScreenSize=1440x2560, networkConnectionEnabled=true, warnings={}, databaseEnabled=false, appActivity=.ui.LauncherUI, locationContextEnabled=false, deviceModel=SM-G9208, fastReset=false, chromeOptions={args=[], extensions=[], androidProcess=com.tencent.mm:appbrand0}}]
Session ID: a9c2ce80-0091-43d1-8c71-73ac8e955e02
appium 日志:
[Chromedriver] Error: session not created exception: please close '' and try aga
in
(Driver info: chromedriver=2.24.417431 (9aea000394714d2fbb20850021f6204f2256b9
cf),platform=Windows NT 6.1.7601 SP1 x86_64)
at Chromedriver.callee$2$0$ (../../lib/chromedriver.js:176:15)
at tryCatch (C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\
node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as next
at GeneratorFunctionPrototype.invoke (C:\Users\Administrator\AppData\Roaming
\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:3
7)
Error: session not created exception: please close '' and try again
(Driver info: chromedriver=2.24.417431 (9aea000394714d2fbb20850021f6204f2256b9
cf),platform=Windows NT 6.1.7601 SP1 x86_64)
at Chromedriver.callee$2$0$ (../../lib/chromedriver.js:176:15)
at tryCatch (C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\
node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as next
at GeneratorFunctionPrototype.invoke (C:\Users\Administrator\AppData\Roaming
\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:3
7)
[MJSONWP] Encountered internal error running command: Error: session not created
exception: please close '' and try again
(Driver info: chromedriver=2.24.417431 (9aea000394714d2fbb20850021f6204f2256b9
cf),platform=Windows NT 6.1.7601 SP1 x86_64)
at Chromedriver.callee$2$0$ (../../lib/chromedriver.js:176:15)
at tryCatch (C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\
node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as next
at GeneratorFunctionPrototype.invoke (C:\Users\Administrator\AppData\Roaming
\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:3
7)
[HTTP] <-- POST /wd/hub/session/a9c2ce80-0091-43d1-8c71-73ac8e955e02/context 500
4980 ms - 357
请问是怎么回事呢?