We have a suite of selenium/c# tests which have been tested in the following locations.
Local in Visual Studio – All good, everything passed 1st run
Jenkins Server – All good, 99% pass 1st run, 100% on first re-run
Azure release pipeline – Mostly good. Total tests 97, 94 pass every time, the remaining 3 fail every time.
Looking at the logs it seems the tests are timing out because an element was not found within 60 seconds, this however never fails local or Jenkins, so why on Azure pipelines? All 3 methods are hitting the same test server for the App under test and they are all using the same test code and it is the same element in each test that is not found.
We are using VS 2022 Prof, Selenium 4.4, MSTest 2.2, Specflow 3.9
I have checked the chromedriver version, it is correct
This is a typical error on the azure server
-> error: The HTTP request to the remote WebDriver server for URL http://localhost:59062/session/899fc92fbc887b4d8431ecfb7e51256f/element timed out after 60 seconds. (125.3s)
<pre> at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)
at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.WebDriver.FindElement(String mechanism, String value)
at OpenQA.Selenium.By.<.ctor>b__11_0(ISearchContext context)
at OpenQA.Selenium.By.FindElement(ISearchContext context)
at OpenQA.Selenium.WebDriver.FindElement(By by)
at TestApp.Pages.TestPage.MatchTheGrandTotal() in D:\a\r1\a\_Regression\PelTest\PageObjects\IntelPage.cs:line 325
at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStepMatch(BindingMatch match, Object[] arguments, TimeSpan& duration)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(IContextManager contextManager, StepInstance stepInstance)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep()
at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors()