-1

I am running appium tests on Azure Devops yaml pipelines

The tests are created in MS Unit Test and in C#

Tests are being run with following command

nohup appium -p 4723 & dotnet test <csproj name> --logger trx --results-directory $(Agent.TempDirectory) --verbosity:detailed

The tests run perfectly on my local Mac machine

On yaml pipeline when i run tests it fails with following error

Assembly Initialization method ......AssemblyInitialization threw exception. OpenQA.Selenium.WebDriverException: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource. Aborting test execution.

This fails at following code

var capURI = "http://127.0.0.1:4723/wd/hub";
Instance = new AndroidDriver<IWebElement>(new Uri(capURI), cap, TimeSpan.FromSeconds(1200));

I added debug logs to check if desired capabilities are correct or not. The desired capabilities are correct.

Greg Burghardt
  • 17,900
  • 9
  • 49
  • 92
Ankit Agrawal
  • 257
  • 1
  • 12
  • https://github.com/appium/appium-inspector/issues/165 maybe this can help. There seems to be a difference between Appium 1.x servers and Appium 2.x servers. – Knight Aug 14 '23 at 12:14

2 Answers2

-1

Check which version is being used in the pipeline machines logs, you need to use the appropriate path for the Appium server you are using. Appium 1.x servers use /wd/hub as the path, and Appium 2.x servers use / as the path.

If you could share the logs it would give more insight to find the issue.

Sushem
  • 39
  • 7
-2

Couple of unknows

  1. var capURI = "http://127.0.0.1:4723/wd/hub"; - this is showing your local server address, please do update the where the appium server is running.

2.If you are correct pointed appium server URL, you may install the appium package into Azure DevOps yaml pipelines, ensure the azure box has the appium package if not please add the following line to your yaml file

Install Appium dependencies

 - script: dotnet add package Appium.WebDriver
    displayName: 'Install Appium Package'
Mani
  • 1,199
  • 2
  • 9
  • 22