Running dotnet core Selenium Tests in Azure DevOps

  Рет қаралды 28,021

Etienne Tremblay (tegaaa)

Etienne Tremblay (tegaaa)

Күн бұрын

Пікірлер: 90
@JonBrookes
@JonBrookes 5 жыл бұрын
Etienne, thank you for publishing this content. I have found it to be very useful. Running Selenium in a pipeline is for me is a must and having used Selenium in the past I hadn't really got handle on getting it to work as you have shown, in a pipeline and within a hosted agent. This has been a great time saver - with your detailing not only the method of packaging the application but also the necessary steps in the pipeline to get the tests published, all invaluable. Thanks again.
@TegaaaSolutions
@TegaaaSolutions 5 жыл бұрын
Jon Brookes glad I could help
@secreto70
@secreto70 3 жыл бұрын
Hello. Thanks. In release it is sending me the error: "Dotnet command failed with non-zero exit code on the following projects : D:\ag3\_w 127\a\_PruebasSelenium_ASP.NET_Core-CI\drop\SeleniumDemo.dll in the Run Selenium Tests task
@coolzsatyen1
@coolzsatyen1 5 жыл бұрын
JUST "WOW", so clean and crisp video, explaining the selenium test as well as integrating in Azure Devops CI/CD
@TegaaaSolutions
@TegaaaSolutions 5 жыл бұрын
Thanks Satyen
@coolzsatyen1
@coolzsatyen1 5 жыл бұрын
@@TegaaaSolutions I was trying to perform "failed test case", were i can see in azure devops "Test" Tab (say e.g. 2 Pass, 1 Fail). So considering your example of google i couldn't perform, Requesting to please add a Failed test case video, whenever you get time. (I am basic learner in Selenium .Net Core)
@Pugalmurugan30
@Pugalmurugan30 5 жыл бұрын
It was a nice video for starting up with Azure and able to successfully create a project, build and release. Thanks Etienne.
@allanpgf
@allanpgf 3 жыл бұрын
Hello Etienne! In the 0:44 seconds of your video you ask us to click on new solution but I don't have this option, can you please help to enable it ? thanks
@roamwithashutosh
@roamwithashutosh 4 жыл бұрын
I am getting error like ##[error]Error: There was an error when attempting to execute the process 'C:\Program Files\dotnet\dotnet.exe'. This may indicate the process failed to start. Error: spawn C:\Program Files\dotnet\dotnet.exe ENOENT, any clue?
@TegaaaSolutions
@TegaaaSolutions 4 жыл бұрын
Have you installed dotnet core on your build server? The same version that you are running locally. You'll need to install the SDK for that version on your build server.
@roamwithashutosh
@roamwithashutosh 4 жыл бұрын
@@TegaaaSolutions it is resolved actually
@roamwithashutosh
@roamwithashutosh 4 жыл бұрын
Hi , thanks for the explanation. But it is working absolutely fine for passed test cases. However, if one test case is failing ..the release is failing..how to deal with this?
@TegaaaSolutions
@TegaaaSolutions 4 жыл бұрын
Well it depends. The intent is that if you have tests that fail you should not continue with the release since there is an issue. You should validate why the test failed, is it the test? is it the application? if it's the test, then you should fix it and retry, if it's the app then you should fix the app. In either case, something is not well with your application and that release should be rolled back or rolled forward depending on how you deal with bug at your company.
@aprilwei5367
@aprilwei5367 3 жыл бұрын
Thank you for the great video! I have a question that I got " Project file(s) matching the specified pattern were not found" message, how to fix it, please?
@savannahralli6988
@savannahralli6988 5 жыл бұрын
I can't get to your starting point in the video. After I create an empty git repo, I don't see the files that you see in 0:35.
@millsaj
@millsaj 5 жыл бұрын
i can help you out if needed. PM me
@jaychauhan3783
@jaychauhan3783 5 жыл бұрын
they are just basic files when you initialize a repository
@ProgramandoDePie
@ProgramandoDePie 5 жыл бұрын
While creating the "empty" but no empty repo, he picked the options to add a README and a .gitignore files. In any case, you should still be able to do all further steps without having those files. Cheers.
@malabarees1644
@malabarees1644 4 жыл бұрын
HI, Thank you for this video , How to run those VStest in order ? can you tell me suppose if i use Nunit what will be the test result format?
@TegaaaSolutions
@TegaaaSolutions 4 жыл бұрын
Target junit you can then upload the Azure DevOps with the upload test result task
@Mbregs28
@Mbregs28 4 жыл бұрын
Let's say I have one solution and two projects: My automation (with mapping and what not) and then a unit test project (the one with my tests). How would that work? I'm trying to use these steps and it seems I'm running into an error "project files matching the specified pattern were not found" and I'm assuming it's because I have two project files?
@TegaaaSolutions
@TegaaaSolutions 4 жыл бұрын
No you should have two projects, your main application and one for your tests. In which project are you seeing this error?
@Mbregs28
@Mbregs28 4 жыл бұрын
@@TegaaaSolutions Thank you very much for responding, I'm running through the video and when it comes to Azure, I'm not able to see the same setup in the video, they must have made changes since the video but I think the problem is that this project I'm doing is .net 4.6.1 and I'm assuming maybe that's where there is a problem? I'm still a bit new to Azure but essentially when I follow the video and go to create the release, it's saying that it fan't find the path to the .dll
@TegaaaSolutions
@TegaaaSolutions 4 жыл бұрын
Moses A ahh yes this video is for .net core a little different. Also azure DevOps has for sure changed in a year
@Mbregs28
@Mbregs28 4 жыл бұрын
@@TegaaaSolutions I can't tell you how much I appreciate the help. I went back and re-did it using .net core and it's getting way further but on the run selenium tests portion of the release it's kicking me an error "The process 'CProgram Files\dotnet\dotnet.exe' failed with exit code 1" have you ever seen this happen?
@TegaaaSolutions
@TegaaaSolutions 4 жыл бұрын
Moses A which agent are you using for the release part it looks like dotnet core is not installed on that machine. Also it may be that I was pointing to it but you sont need to now
@nadkarnia
@nadkarnia 5 жыл бұрын
You just made my day with this video. Thank you.
@bobbysiddhu1599
@bobbysiddhu1599 4 жыл бұрын
Thanks. Detailed explanation. I setup selenium c# test in Azure now, but unfortunately, when the release pipeline runs, getting error in as "##[error]Project file(s) matching the specified pattern were not found." unable to solve it, any help, will be highly appreciated. Thank you,
@TegaaaSolutions
@TegaaaSolutions 4 жыл бұрын
Are you using a windows agent or a Linux one? If you are using a Linux agent you likely need to build on a Linux agent as well or vise versa
@bobbysiddhu1599
@bobbysiddhu1599 4 жыл бұрын
@@TegaaaSolutions Thanks for quick response. I using windows and first build pipeline to build, restore and publish ran successfully but the release pipeline with dotnet core job using vstest fails with above mentioned error..
@TegaaaSolutions
@TegaaaSolutions 4 жыл бұрын
@@bobbysiddhu1599 ok so it’s the same agent for both build and release then. Next thing is the test task parameters are they pointing to get all test dlls? Or is there a filter that does not match the name off your test dll...
@bobbysiddhu1599
@bobbysiddhu1599 4 жыл бұрын
@@TegaaaSolutions . Thanks,, u rightly pointed out. Pipeline was not pointed to right artifacts,..once i corrected that, it executed. Thanks
@jpreddy6152
@jpreddy6152 2 жыл бұрын
@@bobbysiddhu1599 I'm facing the same issue now what artifacts path did you change ?
@soteros1983
@soteros1983 3 жыл бұрын
Great video! One question: Is this possible to run without the headless option? My tests require some "outside the browser" interaction so I think with the headless option some tests might fail.
@TegaaaSolutions
@TegaaaSolutions 3 жыл бұрын
Well you certainly can but your build server would need to run the agent in interactive mode and you’d need to keep a session alive on the build server with the build account to do it. Check docs.microsoft.com/en-us/azure/devops/pipelines/agents/agents?view=azure-devops&tabs=browser#interactive-or-service and docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-windows?view=azure-devops#run-interactively
@TheNikoquebec
@TheNikoquebec 5 жыл бұрын
Hi Etienne, Nice video, I still have a question though, You could have "run" the test in the BUILD pipeline , after building everything right ? the extra step of the RELEASE is not mandatory if you just want to run the test and not actually deploying anything. is it right to say that ? Thanks
@TegaaaSolutions
@TegaaaSolutions 4 жыл бұрын
You can absolutely run the test in the build, BUT, Selenium tests (UI/Functional Tests) are usually run against a deployed instanced. So you normally would want to run this after you released. But if you are deploying inside the build then sure you could run those test there.
@bizoton19
@bizoton19 5 жыл бұрын
first of all - great video. I wonder if this a dotnetcore version issue but when i create the build and dotnet publish, the chrome driver exe doesn't go to the artifact staging directory directly, it's being copied to the source directory even when it says publish chrome driver in the project file
@TegaaaSolutions
@TegaaaSolutions 5 жыл бұрын
Alexandre Salomon hey Alex thanks, did you add the bit in the csproj to publish the chrome driver at publish time. Can’t remember exactly where it is in the video. I had the same issue before adding the bit to the proj
@bizoton19
@bizoton19 5 жыл бұрын
Etienne Tremblay hey yup its there, its actually executing that task it from what i see in the logs and copying the exe from the nuget dir. i basically had to use the artifact staging directory as the output location for the build for all the driver executables to be there in the final published artifacts
@alessandroalmeida2102
@alessandroalmeida2102 5 жыл бұрын
I have a run settings in my project and I can't run my test because of that, I try a lot of commands like "--Settings:Configuration/chrome.dev.runsettings" but I don't why the artefact can't find the path
@TegaaaSolutions
@TegaaaSolutions 5 жыл бұрын
Can’t find the path of the chrome driver? Did you add the publish section in you project?
@alessandroalmeida2102
@alessandroalmeida2102 5 жыл бұрын
@@TegaaaSolutions So, the problem wasn't that. I find the path and everything, but the problem was when to do in this way with .runsettings on release, the path couldn't be found, but if we do this in the build, everything goes fine and I have the same dashboard, graphics, and results like you, I don't find the reason to create and have this results just on release, I'll create an article or tutorial someday about it. If you can talk more about ping me here
@azurenigeriausergroup
@azurenigeriausergroup 4 жыл бұрын
Create stuff Etienne. Thanks. Please where can we get the code you used?
@TegaaaSolutions
@TegaaaSolutions 4 жыл бұрын
I uploaded to github here github.com/tegaaasolutions/SeleniumDemo
@azurenigeriausergroup
@azurenigeriausergroup 4 жыл бұрын
@@TegaaaSolutions Thanks alot.
@SSHenninger
@SSHenninger 4 жыл бұрын
Thanks for this initial setup, very clear. I do have some questions since I did get the tests to run, but they all fail with a chromedriver timeout error. Now our application requires you to log in via AD account. Which works locally, when I'm logged in with a Pulse VPN connection. How would I approach this? Would I need to change the way I log into the account or is there another way?
@TegaaaSolutions
@TegaaaSolutions 4 жыл бұрын
Hooo, ya connecting with Windows Creds (which are different then the account running the tests I presume) is a bit tricky, you need to launch the chrome driver with another user. Check this code as a start gist.github.com/tegaaa/b48a2d0b79808b4cbb05aae850326ffe
@SSHenninger
@SSHenninger 4 жыл бұрын
@@TegaaaSolutions thanks for the suggestion! I'll give it a try!
@sitwalkstand
@sitwalkstand 5 жыл бұрын
Awesome video! Thank you for going through these steps. Do you have any good resources on how to better utilize Selenium for testing web applications? Thanks again!
@TegaaaSolutions
@TegaaaSolutions 5 жыл бұрын
Justin Miller do you specific questions the seleniumhq site has lots of information to author actual tests. If you have a specific problem I can maybe help you better
@ifourmilan8279
@ifourmilan8279 5 жыл бұрын
Currently I am looking automation tool for our cordova app to be test can i use selenium + integrate with Azure DevOps pipeline for our cordova app
@TegaaaSolutions
@TegaaaSolutions 5 жыл бұрын
Well since cordova is built on node.js, you can deploy your app to it's destination (is it a phone application or a web site) and then run your selenium tests from a browser (if web site). If it's a phone application you'd have to setup a subscription on Visual Studio App Center and then you can use the mobile test infrastructure. But I'm not sure if that supports Selenium or you'd need to write some new tests.
@MrDanTheGentleman84
@MrDanTheGentleman84 5 жыл бұрын
Hey Etienne, great tutorial! Could you maybe give me a hint about getting an error at the end of my test steps. The tests are running perfectly and will be published to the test section within the release, but however i receive an error which says: Total tests: 4. Passed: 3. Failed: 1. Skipped: 0. Test execution time: 50.6905 Seconds Error: The process 'C:\Program Files\dotnet\dotnet.exe' failed with exit code 1 Dotnet command failed with non-zero exit code on the following projects : d:\a 1\a\TestProject\drop\TestProject.dll
@TegaaaSolutions
@TegaaaSolutions 5 жыл бұрын
MrDanTheGentleman84 that means you have on of your test that fails and you should be able to see witch on in the tests tab in you environment log
@bitsandbeatsofficial
@bitsandbeatsofficial 3 жыл бұрын
Thanks for this useful upload. I just use NUnit framework with dotnet core. I receive the same error while Releasing. It ran all my test cases but while completing the run test task it says the error above error. error Dotnet command failed with non zero exit code on the following projects. Also I checked the Tests tab, it says no Runs. Plz help me out here tried all possible hacks.. Thanks in Advance..
@alexvillarreal3947
@alexvillarreal3947 3 жыл бұрын
great explanation , very clear and consist, thanks for sharing.
@pierremurasso4004
@pierremurasso4004 5 жыл бұрын
Very interesting and clear thank you!
@kaushikgayal
@kaushikgayal 5 жыл бұрын
That's a good one. Thanks for sharing.
@nibeditadan2216
@nibeditadan2216 4 жыл бұрын
chromedriver.exe is not getting created in artifact, where I am going wrong?
@TegaaaSolutions
@TegaaaSolutions 4 жыл бұрын
Did you add a publish task in your csproj?
@nibeditadan2216
@nibeditadan2216 4 жыл бұрын
@@TegaaaSolutions sorry for the late reply yes I did
@nibeditadan2216
@nibeditadan2216 4 жыл бұрын
@@TegaaaSolutions I did some searching and got a solution for this, attached the code ChromeDriver(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), chromeoptions); ChromeOptions chromeOptions = new ChromeOptions(); var driverPath = Path.Combine(Directory.GetCurrentDirectory()); var envChromeWebDriver = Environment.GetEnvironmentVariable("ChromeWebDriver"); if (!string.IsNullOrEmpty(envChromeWebDriver) && File.Exists(Path.Combine(envChromeWebDriver, "chromedriver.exe"))) { driverPath = envChromeWebDriver; } ChromeDriverService defaultService = ChromeDriverService.CreateDefaultService(driverPath); defaultService.HideCommandPromptWindow = true; driver = (IWebDriver)new ChromeDriver(defaultService, chromeOptions); driver.get(....)
@tusharmohite0
@tusharmohite0 5 жыл бұрын
Can you Create an asp.net web application which can run the selenium test you just created? For eg. We can go to this website and click on a button which says search for cheeze and on button click the script will be executed in azure and we will get the results in a textbox
@TegaaaSolutions
@TegaaaSolutions 4 жыл бұрын
Sorry for the late reply, I'm not sure I understand, you want an application that starts Azure DevOps Release Pipeline to run test and then get the result of the google query in the textbox? Not sure that makes sense...
@GdeNasNet
@GdeNasNet 5 жыл бұрын
What are the settings in "Publish artifacts" ?
@TegaaaSolutions
@TegaaaSolutions 5 жыл бұрын
Roman Tsymbal look around 12:30 you should see them
@MB-oq9ur
@MB-oq9ur 5 жыл бұрын
Can We use Selenium JAva test project instead .Net Core in this process
@TegaaaSolutions
@TegaaaSolutions 5 жыл бұрын
M B yes you can Azure DevOps supports running java applications
@MB-oq9ur
@MB-oq9ur 5 жыл бұрын
@@TegaaaSolutions can you share any link for Azure devops with selenium Java
@ashutosh1622
@ashutosh1622 2 жыл бұрын
Thanks you so much for this video man !
@casualkeys5386
@casualkeys5386 5 жыл бұрын
What is the target framework version that you used sir?
@TegaaaSolutions
@TegaaaSolutions 5 жыл бұрын
Rakesh Chanamala dotnet core 2.2 i think
@KatRollo
@KatRollo 3 жыл бұрын
You don't really need a release pipeline to run Selenium tests. DevOps picks up your unit test runner (xUnit, NUnit, MSTest) rather than Selenium.
@TegaaaSolutions
@TegaaaSolutions 3 жыл бұрын
You are correct Kat but selenium test usually need the application deployed in order to run so that’s why you usually run them as part of the deployment steps
@KatRollo
@KatRollo 3 жыл бұрын
@@TegaaaSolutions You can separate the automation pipeline from the deploy pipeline btw.
@TegaaaSolutions
@TegaaaSolutions 3 жыл бұрын
@@KatRollo oh y’a I know that. :)
@faatimabismilla2881
@faatimabismilla2881 5 жыл бұрын
Great video. Can selenium tests written in java run on azure?
@TegaaaSolutions
@TegaaaSolutions 4 жыл бұрын
Yes they can.
@alessandroalmeida7866
@alessandroalmeida7866 5 жыл бұрын
thank you! amazing
@ksinha143
@ksinha143 5 жыл бұрын
Why are you testing google? Setup will be complicated for any projects we develop.
@TegaaaSolutions
@TegaaaSolutions 5 жыл бұрын
Kapil Sinha its an example you can do tests for your own projects as well. You can go to the selenium site for information on how to find controls.
@v4raziel
@v4raziel 4 жыл бұрын
Thank you Sir.
@venkatx5
@venkatx5 5 жыл бұрын
Ref: Selenium.WebDriver, Selenium.Support, Selenium.WebDriver.ChromeDriver 2.40.0, Microsoft.TestPlatform.TestHost ChromeOptions, headless, donetcore vstest , csporj: true Build: Uncheck Project deploy, Release: --logger:trx;logfilename=TEST.xml merge test results
How to  Run .NET Core Selenium Tests in Azure DevOps
18:03
Imaginet
Рет қаралды 35 М.
Integrating SpecFlow with Azure DevOps
28:59
Edgewords
Рет қаралды 36 М.
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
Multistage Pipeline with Deployment Slots in Azure DevOps
16:45
InGeniusYT
Рет қаралды 26 М.
VanQ Webinar | Running Selenium Automated Tests in Azure DevOps
1:25:34
Optimus Information Inc
Рет қаралды 6 М.
TestComplete Azure DevOps Integration - Pipeline Configuration
16:29
Test Management
Рет қаралды 8 М.
How to run Selenium C# Automation Testing in Docker
11:42
Test Automation 101
Рет қаралды 2,1 М.
Create Pipeline to run automation test cases in Azure DevOps
10:33
Software Development Engineer in Test
Рет қаралды 30 М.
RunningSeleniumJavaTestOnAzure
7:59
AutomationOnTheGo
Рет қаралды 8 М.
Azure Test Plans
44:00
Toronto Enterprise DevOps Usergroup
Рет қаралды 115 М.
Azure DevOps | CI/CD | Build your MVC app
10:45
sizeofeight
Рет қаралды 3,8 М.
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН