Omkar Patil
Omkar Patil

Reputation: 1

Azure pipeline giving error An element could not be located at line WindowsDriver<WindowsElement>(new Uri("http://127.0.0.1:4723"), appiumOptions);

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.

Upvotes: -1

Views: 47

Answers (0)

Related Questions