Azure DevOps How to run a Linux Docker container on Windows Hosted agent - selenium

Is there a way to run Linux Docker images in a Windows Hosted Agent (Hosted Windows Container as recommended here)?
I want to run Linux Selenium Containers hosted in Docker Hub on an Azure DevOps Hosted Agent. I need to run them on a Windows Host because the next tasks in the pipeline (eg. running VS Tests) require a Windows Host.

Related

Deploying to on-prem Windows VM using deployment groups (Devops server is under VPN)

When we deploy our code to an on-premises Windows VM using deployment groups, but the target machine appears offline in Devops after registering the deployment group.
How to establish connection between target server and Devops? Especially when the Devops server is under VPN.

Integrate Automation testing on Linux Agent through Azure Devops pipelline

I am using Azure devops pipeline to create an customized redhat iso. We are creating KVM Virtual machine on the agent host through the same pipeline after iso creation so that we can perform the testing on the VM.
I have tried running the test through vstest but it worked only for windows agent.
Can anyone please guide me with the other options of the test framework to automate the test on the linux agents?

Deploy website to IIS from linux build agent

Problem description
I have a jenkins master that uses a linux build agent to build my ASP.NET Core websites using official MS linux docker containers.
I previously used a windows VM with the necessary tooling installed to build these projects and used MSDeploy.exe to deploy the sites to an IIS webserver. For this deployment I created a web package.
In my linux docker container I obviously can't use MSDeploy.exe.
Question
How can I savely deploy an ASP.NET Core website to an IIS webserver from a linux docker container?
MSDeploy.exe connects to the IIS using a local IIS Users credentials, shutsdown the app, replaces all files that are also present in the new package, so it not just replaces the files but also does some safety settings around the actual replacement.
Misc
I've found this question here, but unfortunately no real answer was found there.
Thanks in advance

How to connect Azure App service to Azure VM?

I have a Selenium Java project which is a web services project. This project has 3 web services.
this project is hosted on azure app service. But Azure app service does not have its own Virtual machine where I can install chrome.
I am very much new to all this. Can anyone help me in linking azure app service to an azure VM where I can install a chrome browser and run automation test cases?
If the VM is allowed to access external webste, of course you can install a chrome browser and run automation test cases.
If the VM is not allowed to access external website, and you want to access Azure App service internally. You can link them via the vnet.
Reference:
Configure VNet Integration with your app

VSTS is it possible to run selenium UI test tasks against localhost web app?

I might be missing something obvious here but my mvc web app is successfully tested using specflow UI tests on my dev machine using localhost but I can't get this to work on a CI Build pipeline in VSTS?
Here is my setup, 1 x Asp.Net solution comprising of:
1 x WebCalculator (MVC app that simply adds 2 numbers together)
1 x UI Specflow tests project
On my Dev machine: I can run the unit tests using NUnit3TestAdapter within visual studio, with my website running at localhost:58909
On VSTS: After the build task, the Visual Studio Test Task is picking up the NUnit Adapter and tries to run the tests (using InternetExplorerDriver server) but fails to find my website running on localhost it seems:
Here's the output:
2017-04-03T09:02:31 Starting test execution, please wait...
2017-04-03T09:02:32 Information: NUnit Adapter 3.7.0.0: Test execution started
2017-04-03T09 Information: Running all tests in C:\a\1\s\WebCalculator.UiTestsNUnitRunner\bin\Release\WebCalculator.UiTestsNUnitRunner.dll
2017-04-03T09:02:32 Information: NUnit3TestExecutor converted 3 of 3 NUnit test cases
2017-04-03T09:02:33 Started InternetExplorerDriver server (32-bit)
2017-04-03T09:02:33 3.0.0.0
2017-04-03T09:02:33 Listening on port 1065
2017-04-03T09:02:33 Only local connections are allowed
2017-04-03T09:03:54 Started InternetExplorerDriver server (32-bit)
2017-04-03T09:03:54 3.0.0.0
2017-04-03T09:03:54 Listening on port 1123
2017-04-03T09:03:54 Only local connections are allowed
2017-04-03T09:03:54 Failed AddTwoNumbers("50","70","120",System.String[])
2017-04-03T09:03:54 ##[error]Error Message:
2017-04-03T09:03:54 ##[error] OpenQA.Selenium.WebDriverTimeoutException : Timed out after 10 seconds
2017-04-03T09:03:54 ##[error] ----> OpenQA.Selenium.NoSuchElementException : Unable to find element with id == summandOne
So my question, is the Visual Studio Test Task smart enough to test against my website which is built as part of the solution at localhost:58909 ?
The example from MS here: https://www.visualstudio.com/en-us/docs/test/continuous-testing/getting-started/continuous-test-selenium
Has the Specflow tests pointing at an XXX.azurewebsites.net url so I'm starting to think that building the website and executing the UI tests together (like I'm attempting) isn't the right approach for this?
Is it the case that when you want to run Specflow tests against a website - I need to build and release this to a hosted environment first??
Based on the source and test paths (c:\a\1\s…), I assume you are using Hosted Agent and do test on build agent. You can’t do it.
First, the Hosted agent is running as service, it can’t run interactive test (selenium UI test).
Secondly, the localhost means the test machine and website machine are at the same machine. Obviously, your website isn’t running in Hosted Agent.
Regarding the article you mentioned, the website is in the azure (baseURL=”https://partsumlimited.azurewebsite....), so it can be access from internet
You can refer to these steps to achieve your requirement:
Setup a on premise build agent that running as interactive mode (if it is running as service mode, you need to do test on remote machine, refer to that article to deploy agent, copy file and run test) Deploy an agent on Windows
Create a new build definition to use that build agent
Add IIS Web App Deployment step or other to deploy your web app to IIS (Deploy your Web Deploy package to IIS servers using WinRM)
Change your website URL in test code (You can use localhost if the build agent is running on the same machine)
Note: If you want to run test on remote machine, the remote machine need to be accessible from build agent.