ADO Microsoft-Hosted Agent unable to navigate control
Hello,
I am trying to get an ADO pipeline to run a Keyword test, and it is failing to do so.
The Keyword test has one enabled step, to navigate to https://www.subzero-wolf.com/ in the Chrome browser. This step functions perfectly when it is run locally on my computer (there's not much that could go wrong). The pipeline has three steps in it: one which installs the Visual Studio Test Platform; one which installs the test runner, in this case I am using TestExecute; and the final VSTest step, which is in charge of running the Keyword Tests.
The first two steps succeed just fine, but on the last step the pipeline throws the error that the test was "Unable to navigate to the https://... page"
The pipeline agent is an MS-Hosted agent, called 'windows-latest'. I have a feeling that there is something wrong with the environment we are running the test in, but I don't have enough knowledge to determine what should be added or removed. I would be happy to provide you with any further information I can give you about the state of the pipeline.
Thank you for your assistance!
Hi everyone, I have the solution.
The Chrome "Choose your user" menu was popping up before the browser could load, and my test was not taking that into account.
The SmartBear support work around for this as of 8/15/2024 is to add a PowerShell command in between the InstallTestCompleteAdapter step and the VSTest step. This tells Chrome that you are using a particular user, so you go immediately to the browser:
- powershell: $chromePath = "C:\Program Files\Google\Chrome\Application\chrome.exe" Set-ItemProperty -Path HKLM:\SOFTWARE\Policies\Google\Chrome -Name PasswordManagerEnabled -Value 0 Set-ItemProperty -Path HKLM:\SOFTWARE\Policies\Google\Chrome -Name PrivacySandboxPromptEnabled -Value 0 Start-Process $chromePath -ArgumentList "--profile-directory=Default", "--no-first-run", "--disable-search-engine-choice-screen" if (Test-Path -Path $chromePath) { $chromeVersion = (Get-Item $chromePath).VersionInfo.ProductVersion Write-Host "Chrome version: $chromeVersion" } else{ Write-Host "Chrome not found at the default location." } Start-Sleep -Seconds 60 Stop-Process -Name 'chrome' Start-Process $chromePath -ArgumentList "--profile-directory=Default", "--no-first-run", "--disable-search-engine-choice-screen" displayName: "Chrome Set Up"
In my file, which can be seen in another thread, this code would start on line 23 and end on line 38.
Good luck!