-1

I am getting the error:

ClassInitialize threw exception. OpenQA.Selenium.WebDriverException: OpenQA.Selenium.WebDriverException: 
   An element could not be located on the page using the given search parameters..
2025-02-13T07:48:27.0449820Z Stack Trace:
2025-02-13T07:48:27.0450277Z at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
2025-02-13T07:48:27.0450578Z at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters)
2025-02-13T07:48:27.0451173Z at OpenQA.Selenium.Appium.AppiumDriver1.Execute(String driverCommandToExecute, Dictionary2 parameters)
2025-02-13T07:48:27.0452283Z at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(String mechanism, String value)
2025-02-13T07:48:27.0452973Z at OpenQA.Selenium.Appium.AppiumDriver1.FindElementByName(String name)

on line:

var sessionb = new WindowsDriver(new Uri("http://127.0.0.1:4723"), appiumOptions);

In my local machine it's working fine, but I am getting this error when I run it through Azure pipeline.

It is a desktop application and I have used winappdriver to automate it. Below tasks I have used for release pipeline but not sure whether it is opening the application or not

I am using azure devops repo to store my code and I am using azure devops pipeline to trigger the tests. I have build pipeline and release pipeline, In build pipeline I am building the solution and in release pipeline I am running the scripts.

I have added a PowerShell task in release pipeline to open the application and to run winappdriver before the tests run.

4
  • Provide the detailed YAML or JSON of the pipeline definition? Commented Feb 14 at 2:41
  • Hi @Bright Ran-MSFT Commented Feb 17 at 9:36
  • I have used Vs Test assemblies, **\bin***test.dll **\bin***tests.dll **\Hermes.dll Commented Feb 17 at 9:39
  • Show your detailed pipeline definition so that we can know how you configure the test tasks in the pipeline. Also the detailed debugging logs of the failed test tasks. Commented Feb 18 at 1:22

1 Answer 1

0

Did you check this doc: WinAppDriver in CI with Azure Pipelines?

  1. WinAppDriver supports self-hosted agents only. (HostedVS2019 and HostedVS2017 are not available)
  2. and you need to enable interactive mode: Interactive vs. service
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.