1

I have create a small test script to open a app and fill some data at the screen. This test works fine with android 5 on Appium server 1.4.16.1

But no I need to run the same test script on a android 7 emulator and when I try to execute the test as soon as application get start ,It will get closed.

Below are my test scripts and Appium Log. For android 7 im using appium V 1.13 server.

    public void AppiumSetupMethod()
    {

        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.SetCapability("version", "4");
        capabilities.SetCapability("deviceName", "emulator-5554");
        capabilities.SetCapability("platformName", "Android");
        capabilities.SetCapability("autoWebview", true);
        capabilities.SetCapability("resetKeyboard", true);
        capabilities.SetCapability("appPackage", "com.nike.snkrs");
        capabilities.SetCapability("appActivity", "feed.activities.TheWallActivity");
        capabilities.SetCapability("autoGrantPermissions", true);
        capabilities.SetCapability("noReset", true);
        try
        {
            AndroidDriver<AppiumWebElement> driver = new AndroidDriver<AppiumWebElement>(new Uri("http://127.0.0.1:4723/wd/hub"), capabilities, TimeSpan.FromMinutes(5));

        }

        catch (Exception e)
        {


        }

        driver.Tap(1, 543, 762, 1000);
    }

 - [ADB] Running 'C:\Users\cja\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am start -W -n com.nike.snkrs/.feed.activities.TheWallActivity -S'
[AndroidDriver] Setting auto webview to context 'WEBVIEW_com.nike.snkrs' with timeout 2000ms
[AndroidDriver] Getting a list of available webviews
[ADB] Running 'C:\Users\cja\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell cat /proc/net/unix'
[AndroidDriver] Found webviews: ["WEBVIEW_chrome"]
[AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_chrome"]
[AndroidDriver] Getting a list of available webviews
[ADB] Running 'C:\Users\cja\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell cat /proc/net/unix'
[AndroidDriver] Found webviews: ["WEBVIEW_chrome"]
[AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_chrome"]
[AndroidDriver] Getting a list of available webviews
[ADB] Running 'C:\Users\cja\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell cat /proc/net/unix'
[AndroidDriver] Found webviews: ["WEBVIEW_chrome"]
[AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_chrome"]
***[AndroidDriver] Getting a list of available webviews
[ADB] Running 'C:\Users\cja\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell cat /proc/net/unix'
[AndroidDriver] Found webviews: ["WEBVIEW_chrome"]
[AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_chrome"]
[AndroidDriver] Shutting down Android driver
[ADB] Running 'C:\Users\cja\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop com.nike.snkrs'
[ADB] Pressing the HOME button
[ADB] Running 'C:\Users\cja\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell input keyevent 3'***
[AndroidBootstrap] Sending command to android: {"cmd":"shutdown"}
[AndroidBootstrap] Received command result from bootstrap
[UiAutomator] Shutting down UiAutomator
[UiAutomator] Moving to state 'stopping'
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"shutdown"}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type SHUTDOWN
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":0,"value":"OK, shutting down"}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Closed client connection
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: numtests=1
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: stream=.
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: current=1
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS_CODE: 0
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: stream=
[AndroidBootstrap] [UIAUTO STDOUT] Test results for WatcherResultPrinter=.
[AndroidBootstrap] [UIAUTO STDOUT] Time: 6.642
[AndroidBootstrap] [UIAUTO STDOUT] OK (1 test)
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS_CODE: -1
[UiAutomator] UiAutomator shut down normally
[UiAutomator] Moving to state 'stopped'
[ADB] Attempting to kill all uiautomator processes
[ADB] Getting IDs of all 'uiautomator' processes
[ADB] Running 'C:\Users\cja\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pgrep \^uiautomator\$'
[ADB] No 'uiautomator' process has been found
[UiAutomator] Moving to state 'stopped'
[Logcat] Stopping logcat capture
[ADB] Running 'C:\Users\cja\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop io.appium.unlock'
[AndroidDriver] Not cleaning generated files. Add `clearSystemFiles` capability if wanted.
[BaseDriver] Event 'newSessionStarted' logged at 1572086971859 (16:19:31 GMT+0530 (Sri Lanka Standard Time))
[MJSONWP] Encountered internal error running command: NoSuchContextError: No such context found.
[MJSONWP]     at AndroidDriver.setContext (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-android-driver\lib\commands\context.js:55:11)
[MJSONWP]     at process._tickCallback (internal/process/next_tick.js:68:7)
[HTTP] <-- POST /wd/hub/session 500 9475 ms - 75
[HTTP] 

So any idea on what need to be change on my test?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.