0
votes

I am running an Azure Pipelines (DevOps) pipeline that builds my automation test solution into a dll, and loads that dll to get all of the integration automation tests.

I am using the default cloud "Host" agents to run the automation. However, the drivers throw tons of errors. I recognize the errors as the same ones that I encountered when I set up automation via Jenkins -- when I was running Jenkins as a service.

To fix the issue in Jenkins, I stopped running it as a Windows service, and started launching it as a java -jar Jenkins.war command in Powershell. That allowed the selenium drivers to launch browsers as normal on the VM's desktop, rather than running the browser instances and drivers completely in memory.

So, when it ran the browser windows and drivers completely in memory, I received the same driver errors as I am now encounting on the Host agents in Azure Pipelines. The problem is that I cannot find how to make the Agents run the tests on the VM desktop. I don't have any idea where to start on solving this problem, and can't seem to find any info online about this.

Edit: To be as clear as possible. The ONLY error occurring is "$ is not defined". This is because the DOM does not load properly because the browser executables and driver executables are running completely in memory, headless. I need to be able to run the executables in a rendered part of the host machines. So, what I mean is, if I were to remote desktop into this machine, I would actively see browser windows rendering, and automation running. Right now though, if I were to remote into this VM, I would see chrome.exe, and chromedriver.exe in TaskManager, but nothing would be visible on the desktop.

1
I'm sorry, you mix so many unrelated things, this question makes no sense. Processes always run in memory, there's no such thing as "VM desktop". Do you mean running them interactively vs. headless? Also you didn't share any errors, so it's hard to say what this is all about.ytrewq
Yes, everything runs in memory. The difference is whether it runs ONLY in memory (headless), versus on the desktop and visible. If you see the application running in your task manager, but no application is available or visible on the desktop, it is running completely in memory, and has no GUI components available to a real user to interact with it. Thanks for downvoting the question. I am not sure how clearer I can be about what I mean.Asyranok
Please look at stackoverflow.com/help/how-to-ask. At the minimum posting which errors you get would help. Also researching common errors (plenty of them explained here on SO) and excluding them would be a good choice.ytrewq
And the only error is "$" is not defined. It is happening because the DOM never loads the page. It is an empty white page with no .js, no .css, and no html.Asyranok
HI Kiril S. Thanks for the reply. The problem is that the errors are not related to the issue. The issue is that the browser processes, Chrome.exe for example - and the browser driver, ChromeDriver.exe for example - are being run completely headless in memory, with no graphical components rendered at the desktop level. The resulting errors are all "$" is not defined. That is because I use Jquery. And the error is happening due to the DOM not loading.Asyranok

1 Answers

0
votes

I found the answer.

https://docs.microsoft.com/en-us/azure/devops/pipelines/test/ui-testing-considerations?view=vsts&tabs=mstest#visible-ui-mode

You must manually configure the hosts to run Selenium non-headless. This will prevent everything from running as a service, which is purely in memory, with no UI components. This is the problem I mentioned that Jenkins encountered when running Jenkins as a service.

The fix for Jenkins running automation with a GUI is the same for the Hosted agents in Azure pipelines, ultimately. It's just a manual configuration. This is done via a plugin and build step in pipelines.