appium-desktop icon indicating copy to clipboard operation
appium-desktop copied to clipboard

Appium with C#-"An unknown server-side error occurred"- Cannot find apk location

Open YanivSternQA opened this issue 5 years ago • 3 comments

Appium or Appium Desktop?

You are reporting an issue at the Appium Desktop repository. Appium Desktop is a wrapper around Appium. If you are having trouble running tests, it is much more likely that the problem you are encountering is not a problem with Appium Desktop but with Appium. For that reason we require you to have tried your testcase with Appium CLI before reporting issues. Check the checkbox below to confirm that you have proven your issue does not reproduce on Appium itself:

  • [V ] I have verified that my issue does not occur with Appium and should be investigated as an Appium Desktop issue

The problem

I am trying to setup & run appium (desktop OR CLI) via VisualStudio (C#) and i'm getting this error: Appium Log: [Appium] Appium v1.18.2 creating new AndroidUiautomator2Driver (v1.56.1) session [debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided [debug] [BaseDriver] Creating session with W3C capabilities: { [debug] [BaseDriver] "alwaysMatch": { [debug] [BaseDriver] "appium:UIAutomator2": "Android", [debug] [BaseDriver] "appium:deviceName": "Pixel 3a", [debug] [BaseDriver] "appium:app": "‪C:\Users\Yaniv\MMApp.apk", [debug] [BaseDriver] "appium:chromedriverExecutable": "‪C:\TestLogs\chromedriver.exe", [debug] [BaseDriver] "platformName": "Android" [debug] [BaseDriver] }, [debug] [BaseDriver] "firstMatch": [ [debug] [BaseDriver] {} [debug] [BaseDriver] ] [debug] [BaseDriver] } [BaseDriver] The following capabilities were provided, but are not recognized by Appium: [BaseDriver] UIAutomator2 [BaseDriver] Session created with session id: ce300ce7-ebeb-4cc9-9421-a0e0aa896993 [debug] [UiAutomator2] Deleting UiAutomator2 session [debug] [BaseDriver] Event 'newSessionStarted' logged at 1601791967183 (09:12:47 GMT+0300 (Israel Daylight Time)) [debug] [W3C] Encountered internal error running command: Error: The application at '‪C:\Users\Yaniv\MMApp.apk' does not exist or is not accessible [debug] [W3C] at C:\Users\Yaniv\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\basedriver\helpers.js:235:13 [debug] [W3C] Destroying socket connection [HTTP] <-- POST /wd/hub/session 500 445 ms - 735 [HTTP]

The apk path: '‪C:\Users\Yaniv\MMApp.apk' is exist for 100% because if i'm running appium desktop without VS - it identifies the file. Also tested with file location- copy&paste leads to the apk.

Can anyone help me with this? My code in VS: ` public void Setup() { var appPath = @"‪C:\Users\Yaniv\MMApp.apk";

        var driverOptions = new AppiumOptions();
        driverOptions.AddAdditionalCapability(AutomationName.AndroidUIAutomator2, "Android");
        driverOptions.AddAdditionalCapability(MobileCapabilityType.PlatformName, "Android");
        driverOptions.AddAdditionalCapability(MobileCapabilityType.DeviceName, "Pixel 3a");
        driverOptions.AddAdditionalCapability(MobileCapabilityType.App, appPath);

        driverOptions.AddAdditionalCapability("chromedriverExecutable", @"‪C:\TestLogs\chromedriver.exe");

        _driver = new AndroidDriver<AndroidElement>(new Uri("http://localhost:4723/wd/hub"), driverOptions);



        _driver.FindElementByXPath("//android.widget.TextView[@text='User Name']").Click();

    }`

Environment

  • I am running Appium Desktop version <1.18.2.0>.
  • I am on (pick one):
    • [ ] Mac
    • [V] Windows
    • [ ] Linux

YanivSternQA avatar Oct 04 '20 06:10 YanivSternQA

https://discuss.appium.io/ also may help...

KazuCocoa avatar Oct 04 '20 18:10 KazuCocoa

@KazuCocoa , Couldn't find this type of issue in the appium support.

YanivSternQA avatar Oct 05 '20 05:10 YanivSternQA

I mean you can post the environment issue to the form. I do not have good experience with VS, so I cannot help it..

KazuCocoa avatar Oct 05 '20 15:10 KazuCocoa