Currently, I am encountering challenges with my Selenium tests failing both locally and on the DevOps Azure pipeline for Selenium testing.
The root of the error seems to be a version discrepancy between the browser and driver being utilized.
Despite attempting to install an updated Chrome driver, the error persists. Even on the pipeline, it indicates that both drivers are incorrect versions for the browser in use. Previously, the Selenium Tests ran smoothly without any issues.
Displayed below is the content of my csproj file for the test project:
<ItemGroup>
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
<PackageReference Include="Selenium.WebDriver" Version="4.4.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Vsxmd" Version="1.4.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<None Update="appsettings.test.json" CopyToOutputDirectory="Always"></None>
<None Update="Drivers\chromedriver.exe">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Drivers\msedgedriver.exe">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
In the folder below, I have stored the drivers:
https://i.sstatic.net/snspu.png
The issue identified states that the browser being used does not match the driver version.
https://i.sstatic.net/jwqxo.png
The driver folder that gets outputted to Tests.Selenium\bin\Debug\net6.0 contains the older version instead of the newly updated version. https://i.sstatic.net/wHMf9.png
How can I determine the correct version needed to align with the browser running on the pipeline and locally?