WinAppDriver exited unexpectedly with code 3221225781. Any solution?


#1

I am trying to automate window calculator app to start desktop application testing using appium.
I am using the sample code giving on github. But facing some issue.
Appium server version is 1.7.2

Appium logs:

[HTTP] <-- POST /wd/hub/session - - ms - - 
[Appium] Welcome to Appium v1.7.2
[Appium] Non-default server args:
[Appium]   address: 127.0.0.1
[Appium] Appium REST http interface listener started on 127.0.0.1:4723
[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"app":"Calculator","platformName":"Windows","deviceName":"JITENDER-QA"}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"Calculator","platformName":"Windows","deviceName":"JITENDER-QA"},null,null]
[BaseDriver] Event 'newSessionRequested' logged at 1519707069217 (10:21:09 GMT+0530 (India Standard Time))
[Appium] Creating new WindowsDriver (v1.0.0) session
[Appium] Capabilities:
[Appium]   app: Calculator
[Appium]   platformName: Windows
[Appium]   deviceName: JITENDER-QA
[BaseDriver] The following capabilities were provided, but are not recognized by appium: app.
[BaseDriver] Session created with session id: 5954b7ba-b1fb-4970-8bf1-f37a6703fd81
[WinAppDriver] You must use WinAppDriver version 1.0
[WinAppDriver] Verifying WinAppDriver version 1.0 is installed via comparing the checksum.
[WinAppDriver] WinAppDriver changed state to 'starting'
[WinAppDriver] Killing any old WinAppDrivers on same port, running: FOR /F "usebackq tokens=5" %a in (`netstat -nao ^| findstr /R /C:"4724 "`) do (FOR /F "usebackq" %b in (`TASKLIST /FI "PID eq %a" ^| findstr /I winappdriver.exe`) do (IF NOT %b=="" TASKKILL /F /PID %a))
[WinAppDriver] No old WinAppDrivers seemed to exist
[WinAppDriver] Spawning winappdriver with: 4724/wd/hub
[WinAppDriver] WinAppDriver exited unexpectedly with code 3221225781, signal null
[WinAppDriver] WinAppDriver changed state to 'stopped'

My appium script is:

import java.net.URL;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

import io.appium.java_client.windows.WindowsDriver;

public class Cal1 {

private static WindowsDriver CalculatorSession = null;
private static WebElement CalculatorResult = null;

@BeforeTest
public static void setup() {
    try {
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability("app", "Microsoft.WindowsCalculator_8wekyb3d8bbwe!App");
        capabilities.setCapability("deviceName", "JITENDER-QA");
        CalculatorSession = new WindowsDriver<WebElement>(new URL("http://127.0.0.1:4723/wd/hub/"), capabilities);
        CalculatorSession.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);

        CalculatorResult = CalculatorSession.findElementByAccessibilityId("CalculatorResults");
        Assert.assertNotNull(CalculatorResult);

    }catch(Exception e){
        e.printStackTrace();
    } finally {
    }
}

@Test
public void Subtraction()
{
    CalculatorSession.findElementByName("Nine").click();
    CalculatorSession.findElementByName("Minus").click();
    CalculatorSession.findElementByName("One").click();
    CalculatorSession.findElementByName("Equals").click();
    Assert.assertEquals("8", _GetCalculatorResultText());
}

protected String _GetCalculatorResultText()
{
    // trim extra text and whitespace off of the display value
    return CalculatorResult.getText().replace("Display is", "").trim();
}

@AfterClass
public static void TearDown()
{
    CalculatorResult = null;
    if (CalculatorSession != null) {
        CalculatorSession.quit();
    }
    CalculatorSession = null;
}

}

Please help me resolve this issue.
@Aleksei @Telmo_Cardoso @Daniel_Graham
Any help?


#2

@jitenderbhardwaj try to follow https://github.com/rust-lang/rust/issues/42744


#3

@Aleksei
I tried installing/repairing the required components. It is still giving the same error.
Any help!

Thanks


#4

@Aleksei I was trying to automate the window desktop app on windows 7 but after a lot of research i searched the prerequisite for automating a window application, then i came to know that minimum windows 10 should be used. I will try it on windows 10 and then share my scenario.

Thanks!


#5

I can confirm this behavior on Windows 10 when running the calculator sample test. Log follows:

[Appium] Welcome to Appium v1.10.0
[Appium] Non-default server args:
[Appium] address: 127.0.0.1
[Appium] Appium REST http interface listener started on 127.0.0.1:4723
[HTTP] --> POST /wd/hub/session
[HTTP] {“desiredCapabilities”:{“app”:“Microsoft.WindowsCalculator_8wekyb3d8bbwe!App”,“platform”:“Windows”,“deviceName”:“WindowsPC”,“platformName”:“Windows”}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{“app”:“Microsoft.WindowsCalculator_8wekyb3d8bbwe!App”,“platform”:“Windows”,“deviceName”:“WindowsPC”,“platformName”:“Windows”},null,null]
[BaseDriver] Event ‘newSessionRequested’ logged at 1549294299576 (16:31:39 GMT+0100 (Střední Evropa (běžný čas)))
[Appium] Creating new WindowsDriver (v1.5.1) session
[Appium] Capabilities:
[Appium] app: Microsoft.WindowsCalculator_8wekyb3d8bbwe!App
[Appium] platform: Windows
[Appium] deviceName: WindowsPC
[Appium] platformName: Windows
[BaseDriver] Creating session with MJSONWP desired capabilities: {“app”:“Microsoft.WindowsCa…
[BaseDriver] The following capabilities were provided, but are not recognized by appium: app, platform.
[BaseDriver] Session created with session id: 58306391-eb4a-4747-a73d-4a1302f6d90a
[WinAppDriver] You must use WinAppDriver version 1.1
[WinAppDriver] Verifying WinAppDriver version 1.1 is installed via comparing the checksum.
[WinAppDriver] WinAppDriver changed state to ‘starting’
[WinAppDriver] Killing any old WinAppDrivers on same port, running: FOR /F “usebackq tokens=5” %a in (netstat -nao ^| findstr /R /C:"4724 ") do (FOR /F “usebackq” %b in (TASKLIST /FI "PID eq %a" ^| findstr /I winappdriver.exe) do (IF NOT %b==”" TASKKILL /F /PID %a))
[WinAppDriver] No old WinAppDrivers seemed to exist
[WinAppDriver] Spawning winappdriver with: 4724/wd/hub
[WinAppDriver] [STDOUT] Windows Application Driver listening for requests at: http://127.0.0.1:4724/wd/hub
[JSONWP Proxy] Proxying [GET /status] to [GET http://127.0.0.1:4724/wd/hub/status] with no body
[WinAppDriver] [STDOUT]
[WinAppDriver] [STDOUT] Address ‘http://127.0.0.1:4724/wd/hub’ is already in use
[WinAppDriver] [STDOUT]
[WinAppDriver] [STDOUT] Failed to initialize: 0x80004005
[WinAppDriver] [STDOUT]
[WinAppDriver] [STDOUT]
[WinAppDriver] [STDOUT] ==========================================
[WinAppDriver] [STDOUT] GET /wd/hub/status HTTP/1.1
[WinAppDriver] [STDOUT] Accept: application/json, /
[WinAppDriver] [STDOUT] Connection: close
[WinAppDriver] [STDOUT] Content-Type: application/json; charset=utf-8
[WinAppDriver] [STDOUT] Host: 127.0.0.1:4724
[WinAppDriver] [STDOUT] User-Agent: appium
[WinAppDriver] [STDOUT]
[WinAppDriver] [STDOUT]
[WinAppDriver] [STDOUT] HTTP/1.1 200 OK
[WinAppDriver] [STDOUT] Content-Length: 147
[WinAppDriver] [STDOUT] Content-Type: application/json
[WinAppDriver] [STDOUT]
[WinAppDriver] [STDOUT] {“build”:{“revision”:“18001”,“time”:“Tue Sep 18 18:35:38 2018”,“version”:“1.1.1809”},“os”:{“arch”:“amd64”,“name”:“windows”,“version”:“10.0.17134”}}
[JSONWP Proxy] Got response with status 200: “{“build”:{“revision”:“18001”,“time”:“Tue Sep 18 18:35:38 2018”,“version”:“1.1.1809”},“os”:{“arch”:“amd64”,“name”:“windows”,“version”:“10.0.17134”}}”
[WinAppDriver] Status call returned 200. we’re online and ready to run tests
[WinAppDriver] WinAppDriver changed state to ‘online’
[JSONWP Proxy] Matched ‘/session’ to command name ‘createSession’
[JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:4724/wd/hub/session] with body: {“desiredCapabilities”:{“app”:“Microsoft.WindowsCalculator_8wekyb3d8bbwe!App”,“platform”:“Windows”,“deviceName”:“WindowsPC”,“platformName”:“Windows”}}
[WinAppDriver] WinAppDriver exited unexpectedly with code 2147500037, signal null
[WinAppDriver] WinAppDriver changed state to ‘stopped’