When I change context from native to webview I get some exceptiong


#1

I use this to change context
image

before test i have changed chromeDriver to suit chrom

the exception is

io.appium.java_client.NoSuchContextException: An unknown server-side error occurred while processing the command. Original error: Failed to start Chromedriver session: An unknown server-side error occurred while processing the command. Original error: unknown error: unable to discover open pages
(Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.16299 x86_64)
Build info: version: ‘3.12.0’, revision: ‘7c6e0b3’, time: ‘2018-05-08T14:04:26.12Z’
System info: host: ‘TS20180808016’, ip: ‘172.16.26.119’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_171’
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities {appActivity: cn.tuhu.merchant.login.Star…, appPackage: cn.tuhu.merchant, autoGrantPermissions: true, chromedriverExecutable: C:\Program Files (x86)\Appi…, databaseEnabled: false, desired: {appActivity: cn.tuhu.merchant.login.Star…, appPackage: cn.tuhu.merchant, autoGrantPermissions: true, chromedriverExecutable: C:\Program Files (x86)\Appi…, deviceName: 9e5facd07d53, noReset: false, platformName: android, platformVersion: 6.0.1, udid: 9e5facd07d53}, deviceManufacturer: Xiaomi, deviceModel: Redmi 3S, deviceName: 9e5facd07d53, deviceScreenSize: 720x1280, deviceUDID: 9e5facd07d53, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, noReset: false, platform: LINUX, platformName: Android, platformVersion: 6.0.1, takesScreenshot: true, udid: 9e5facd07d53, warnings: {}, webStorageEnabled: false}
Session ID: 69505355-684b-4c10-849c-f5e805ec4054
at io.appium.java_client.AppiumDriver.context(AppiumDriver.java:201)
at com.autotest.app.android.pages.pages_8241.AppCashierDeskPage.pay(AppCashierDeskPage.java:62)
at com.autotest.app.android.steps.CommercialTenantDealOrderInAppStep.商户app安装订单(CommercialTenantDealOrderInAppStep.java:115)
at ✽.商户App安装订单(D:/forkProject/mendiantest/MenDianTest/src/test/resources/features_system_android_smoking/8241-AppSmoking.feature:13)
Caused by: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Failed to start Chromedriver session: An unknown server-side error occurred while processing the command. Original error: unknown error: unable to discover open pages
(Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.16299 x86_64)
Build info: version: ‘3.12.0’, revision: ‘7c6e0b3’, time: ‘2018-05-08T14:04:26.12Z’
System info: host: ‘TS20180808016’, ip: ‘172.16.26.119’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_171’
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities {appActivity: cn.tuhu.merchant.login.Star…, appPackage: cn.tuhu.merchant, autoGrantPermissions: true, chromedriverExecutable: C:\Program Files (x86)\Appi…, databaseEnabled: false, desired: {appActivity: cn.tuhu.merchant.login.Star…, appPackage: cn.tuhu.merchant, autoGrantPermissions: true, chromedriverExecutable: C:\Program Files (x86)\Appi…, deviceName: 9e5facd07d53, noReset: false, platformName: android, platformVersion: 6.0.1, udid: 9e5facd07d53}, deviceManufacturer: Xiaomi, deviceModel: Redmi 3S, deviceName: 9e5facd07d53, deviceScreenSize: 720x1280, deviceUDID: 9e5facd07d53, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, noReset: false, platform: LINUX, platformName: Android, platformVersion: 6.0.1, takesScreenshot: true, udid: 9e5facd07d53, warnings: {}, webStorageEnabled: false}
Session ID: 69505355-684b-4c10-849c-f5e805ec4054
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:231)
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 io.appium.java_client.AppiumDriver.context(AppiumDriver.java:198)
at com.autotest.app.android.pages.pages_8241.AppCashierDeskPage.pay(AppCashierDeskPage.java:62)
at com.autotest.app.android.steps.CommercialTenantDealOrderInAppStep.商户app安装订单(CommercialTenantDealOrderInAppStep.java:115)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at cucumber.runtime.Utils$1.call(Utils.java:31)
at cucumber.runtime.Timeout.timeout(Timeout.java:16)
at cucumber.runtime.Utils.invoke(Utils.java:25)
at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:37)
at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:40)
at cucumber.api.TestStep.executeStep(TestStep.java:102)
at cucumber.api.TestStep.run(TestStep.java:83)
at cucumber.api.TestCase.run(TestCase.java:58)
at cucumber.runner.Runner.runPickle(Runner.java:80)
at cucumber.runtime.Runtime.runFeature(Runtime.java:119)
at cucumber.runtime.Runtime.run(Runtime.java:104)
at cucumber.api.cli.Main.run(Main.java:36)
at cucumber.api.cli.Main.main(Main.java:18)

and the log from is
io.appium.java_client.NoSuchContextException: An unknown server-side error occurred while processing the command. Original error: Failed to start Chromedriver session: An unknown server-side error occurred while processing the command. Original error: unknown error: unable to discover open pages
(Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.16299 x86_64)
Build info: version: ‘3.12.0’, revision: ‘7c6e0b3’, time: ‘2018-05-08T14:04:26.12Z’
System info: host: ‘TS20180808016’, ip: ‘172.16.26.119’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_171’
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities {appActivity: cn.tuhu.merchant.login.Star…, appPackage: cn.tuhu.merchant, autoGrantPermissions: true, chromedriverExecutable: C:\Program Files (x86)\Appi…, databaseEnabled: false, desired: {appActivity: cn.tuhu.merchant.login.Star…, appPackage: cn.tuhu.merchant, autoGrantPermissions: true, chromedriverExecutable: C:\Program Files (x86)\Appi…, deviceName: 9e5facd07d53, noReset: false, platformName: android, platformVersion: 6.0.1, udid: 9e5facd07d53}, deviceManufacturer: Xiaomi, deviceModel: Redmi 3S, deviceName: 9e5facd07d53, deviceScreenSize: 720x1280, deviceUDID: 9e5facd07d53, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, noReset: false, platform: LINUX, platformName: Android, platformVersion: 6.0.1, takesScreenshot: true, udid: 9e5facd07d53, warnings: {}, webStorageEnabled: false}
Session ID: 69505355-684b-4c10-849c-f5e805ec4054
at io.appium.java_client.AppiumDriver.context(AppiumDriver.java:201)
at com.autotest.app.android.pages.pages_8241.AppCashierDeskPage.pay(AppCashierDeskPage.java:62)
at com.autotest.app.android.steps.CommercialTenantDealOrderInAppStep.商户app安装订单(CommercialTenantDealOrderInAppStep.java:115)
at ✽.商户App安装订单(D:/forkProject/mendiantest/MenDianTest/src/test/resources/features_system_android_smoking/8241-AppSmoking.feature:13)
Caused by: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Failed to start Chromedriver session: An unknown server-side error occurred while processing the command. Original error: unknown error: unable to discover open pages
(Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.16299 x86_64)
Build info: version: ‘3.12.0’, revision: ‘7c6e0b3’, time: ‘2018-05-08T14:04:26.12Z’
System info: host: ‘TS20180808016’, ip: ‘172.16.26.119’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_171’
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities {appActivity: cn.tuhu.merchant.login.Star…, appPackage: cn.tuhu.merchant, autoGrantPermissions: true, chromedriverExecutable: C:\Program Files (x86)\Appi…, databaseEnabled: false, desired: {appActivity: cn.tuhu.merchant.login.Star…, appPackage: cn.tuhu.merchant, autoGrantPermissions: true, chromedriverExecutable: C:\Program Files (x86)\Appi…, deviceName: 9e5facd07d53, noReset: false, platformName: android, platformVersion: 6.0.1, udid: 9e5facd07d53}, deviceManufacturer: Xiaomi, deviceModel: Redmi 3S, deviceName: 9e5facd07d53, deviceScreenSize: 720x1280, deviceUDID: 9e5facd07d53, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, noReset: false, platform: LINUX, platformName: Android, platformVersion: 6.0.1, takesScreenshot: true, udid: 9e5facd07d53, warnings: {}, webStorageEnabled: false}
Session ID: 69505355-684b-4c10-849c-f5e805ec4054
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:231)
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 io.appium.java_client.AppiumDriver.context(AppiumDriver.java:198)
at com.autotest.app.android.pages.pages_8241.AppCashierDeskPage.pay(AppCashierDeskPage.java:62)
at com.autotest.app.android.steps.CommercialTenantDealOrderInAppStep.商户app安装订单(CommercialTenantDealOrderInAppStep.java:115)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at cucumber.runtime.Utils$1.call(Utils.java:31)
at cucumber.runtime.Timeout.timeout(Timeout.java:16)
at cucumber.runtime.Utils.invoke(Utils.java:25)
at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:37)
at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:40)
at cucumber.api.TestStep.executeStep(TestStep.java:102)
at cucumber.api.TestStep.run(TestStep.java:83)
at cucumber.api.TestCase.run(TestCase.java:58)
at cucumber.runner.Runner.runPickle(Runner.java:80)
at cucumber.runtime.Runtime.runFeature(Runtime.java:119)
at cucumber.runtime.Runtime.run(Runtime.java:104)
at cucumber.api.cli.Main.run(Main.java:36)
at cucumber.api.cli.Main.main(Main.java:18)

i’m very for that my enlish is poor
and i really need help
thanks