Applcation is getting lauched but still getting this error Same code works for same apk files while for some apk files exception is getting designated | Appium Training|Appium tutorials

Appium Training Forum

Applcation is getting lauched but still getting this error Same code works for same apk files while for some apk files exception is getting designated

A
ANKUR SHARMA Post on 24/11/2018

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

Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:05:20.749Z'

System info: host: 'DESKTOP-1K06GMA', ip: '192.168.0.5', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_172'

Driver info: driver.version: AndroidDriver

at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:195)

at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:209)

at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:231)

at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)

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:212)

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:93)

at com.flipkart.testCases.FashionTest.FashionTest(FashionTest.java:43)

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 org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)

at org.testng.internal.Invoker.invokeMethod(Invoker.java:571)

at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:707)

at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:979)

at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)

at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)

at org.testng.TestRunner.privateRun(TestRunner.java:648)

at org.testng.TestRunner.run(TestRunner.java:505)

at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)

at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)

at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)

at org.testng.SuiteRunner.run(SuiteRunner.java:364)

at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)

at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)

at org.testng.TestNG.runSuitesSequentially(TestNG.java:1187)

at org.testng.TestNG.runSuitesLocally(TestNG.java:1116)

at org.testng.TestNG.runSuites(TestNG.java:1028)

at org.testng.TestNG.run(TestNG.java:996)

at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114)

at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)

at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)

Caused by: java.lang.reflect.InvocationTargetException

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 io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:185)

... 38 more

Caused by: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.flipkart.android' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: 'com.flipkart.android.SplashActivity' or 'com.flipkart.android.com.flipkart.android.SplashActivity' never started. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting

Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:05:20.749Z'

System info: host: 'DESKTOP-1K06GMA', ip: '192.168.0.5', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_172'

Driver info: driver.version: AndroidDriver

remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.flipkart.android' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: 'com.flipkart.android.SplashActivity' or 'com.flipkart.android.com.flipkart.android.SplashActivity' never started. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting

    at getResponseForW3CError (C:\Users\Ankur\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:826:9)

    at asyncHandler$ (C:\Users\Ankur\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:404:37)

    at tryCatch (C:\Users\Ankur\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)

    at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\Ankur\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)

    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\Ankur\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)

    at GeneratorFunctionPrototype.invoke (C:\Users\Ankur\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(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.W3CHandshakeResponse.lambda$new$0(W3CHandshakeResponse.java:57)

at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$getResponseFunction$2(W3CHandshakeResponse.java:104)

at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:122)

at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)

at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)

at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)

at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)

at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)

at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)

at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)

at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)

at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)

at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:125)

... 43 more

A

Instructor

aditya Reply on 29/11/2018

Please shareyour testing device details (onw in which snippet worked and one in which it failed).Also share your code snippet

A
ANKUR SHARMA Reply on 01/12/2018

public class SecondTest {

WebDriver driver;

@Test
public void testApp() throws MalformedURLException, InterruptedException {
File app = new File(System.getProperty("user.dir")+"\\apks\\WhatsApp_2.18.46.apk");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName", "Lenovo K8 Note");
capabilities.setCapability("platformVersion","8.0");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("noReset", true);
capabilities.setCapability("app",app.getAbsolutePath());
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);
Thread.sleep(10000);
}

@AfterTest
public void quit(){
if(driver!=null)
driver.quit();
}

}

A

Instructor

aditya Reply on 11/12/2018

please udid

A

Instructor

aditya Reply on 27/12/2018

Use udid