Jenkins - I had configured MS Test plugin with jenkins, but Ms test displaying result -> starting execution. No tests to execute - jenkins

I had configured MSTest plugin in jenkins, but I am not able to run the unit automation tests. Actually the project is in TFS, where the unit tests are written. I had specified all .dll's path in Jenkins but Console output says No tests to execute

Related

How to run the Automated testcases from the TestPlan in AzureDevops

I am pretty new to Azure Devops. Currently i am trying to run The Automated Selenium (C#) testcases from Test Plans in Azure Devops.
I am referring to the following link to set up the Release Plan to Run Automated Tests from Test Plan
https://learn.microsoft.com/en-us/azure/devops/test/run-automated-tests-from-test-hub?view=azure-devops
I am able to link the Release Pipeline with the testplan and execute the test by creating a new Release. But when the testcases are executed from testplan, Below error is displayed. Its able to identify the Automated test. But in the second stage (Validating Stage) below error is displayed.
The error:
Validating stage:The selected stage does not have the right version or
settings of the Visual Studio Test task to run tests.
Steps Followed:
Created a TestPlan under TestPlan in Azure Devops
Added the testsuite and the testcases. Associated the Automated testscripts with the testcase.
Created a Release Plan from the Run automated tests from Test Manager template.
Task Added to the Release Pipeline:
Visual Studio Test Task
Configuration of Visual Studio Test Task:
Select tests using: TestPlan
Test suite: Autopopulated the Tetplan to which the Release Plan is linked
Test configuration: 1 - Windows 10 (default value)
Search folder: $(Agent.ReleaseDirectory)
The Build Artifacts for the Build Pipelines publish the Build artifacts in the $(Agent.ReleaseDirectory) folder.
Agent Used: Self Hosted Agent.
To run the automated testSripts by selecting the test cases from Test Plan.
Follow the instructions here https://learn.microsoft.com/en-us/azure/devops/test/run-automated-tests-from-test-hub?view=azure-devops
Note: For Visual Studio Test Task in release pipeline, Under the test
selection group, for Select test using option, select "Test run" by
default Test Assembies are selected
The documentation indicates you should verify that Select tests using is set to Test run. You can modify the setting and try again.

Can Jenkins notify me immediately when a unit or integration test fails?

I want to try a Jenkins plugin that notifies me immediately when a junit or selenium test fails during a maven build. Not sure if this is possible or how to go about. Are there any existing plugins that I could modify?

CodedUI tests Error calling Initialization method for test class while running through Jenkins

I have few Coded UI tests which are not in TFS. I was running these tests as ordered test from the CommandLine using the command:
vstest.console OrderedTest2.orderedtest
Now, I want to run this through Jenkins but i am seeing the below error:
Error Message:
Error calling Initialization method for test class SAClientAutomation.testsuites.SABVTSuite: Microsoft.VisualStudio.TestTools.UITest.Extension.UITestException: To run tests that interact with the desktop, you must set up the test agent to run as an interactive process. For more information, see "How to: Set Up Your Test Agent to Run Tests That Interact with the Desktop" (http://go.microsoft.com/fwlink/?LinkId=255012)
I have installed Test Agent and Test Controller but i don't what to next.
The code is not in TFS. Is TFS & MTM(Microsoft Test Manager) compulsory to achieve this?
Yes, TFS & MTM can run Coded UI tests. If you use TFS 2015.1 and previous versions, you need MTM to run the Coded UI tests, check: https://msdn.microsoft.com/en-us/library/ff472576(v=vs.120).aspx.
If you use TFS 2015.2 and later versions, you can use Run Functional Tests task directly in TFS build definition to run Coded UI tests. Check https://blogs.msdn.microsoft.com/visualstudioalm/2016/03/31/executing-automated-tests-in-build-vnext-using-test-plan-test-suites/.
In order to run coded UI tests in TFS 2015.2 and later, you need to deploy build agent and test agent in Interactive Process:
https://www.visualstudio.com/en-us/docs/build/actions/agents/v1-windows
https://www.visualstudio.com/en-us/docs/build/steps/test/visual-studio-test-agent-deployment

Publishing JUnit results from Jenkins to SonarQube not on same server

I've got the following setup:
server 192.168.0.xxx running Jenkins 1.643
server 192.168.0.yyy running SonarQube 5.2 (with Java 1.8.0_66)
server 192.168.0.zzz running PostgreSQL as SonarQube DB (FYI)
I want Jenkins to run a SonarQube analysis on a specific project. I therefore created a job with goal sonar:sonar -Dsonar.host.url=http://192.168.0.yyy. Everything's working well except for code coverage in SonarQube. It says there's a coverage of 0,0 % although there are several tests run by Jenkins.
So I'm pretty sure test results are not published to SonarQube. Google brought me to solutions exporting the results to a directory on the same server and telling SonarQube this directory via -Dsonar.junit.reportsPath.
But this solution is not that easy to implement having Jenkins and SonarQube not on the same server. Long story short: is there another way publishing JUnit test results to SonarQube?
The report path should point to a directory where the analysis is run not on the sonarqube server
So when you are running the sonar:sonar command just use the -Dsonar.junit.reportsPath to point to the the directory containing the report of unit test execution and you should be fine.

Configure Jenkins to Execute tests in UFT

I am running UFT Test Suite manually on the host machine, however i now have the requirement to run the smoke tests as soon as the new build is delivered in jenkins. For that i need to run the test suite automatically using Jenkings. Can someone help me in the direction, how this can be achieved? I have never used Jenkins before.
Looks like theres a plugin for Jenkins which enables integration with HP UFT. Take a look at the Jenkins wiki page for instructions about how to install and use it.
As you didn't mention that you are using ALM so I am assuming that you have some kind of driver script in vbs which runs your test suite. You do not necessarily require any plugin in jenkins to run your UFT suite(however you can also check the suggestion given in the previous answer). Create a job in jenkins and call your vbs file (driver file) or a bat file which kicks off your execution your test machine.
Your test execution machine can be configured as jenkins slave. Only thing which you need to take care off is to remove the settings which can let go your jenkins slave machine which is your uft execution machine in standby mode or locked user mode(uft scripts will fail otherwise). You can handle this by configuring windows settings(if admin allows) or by using some small scripts to move mouse after some intervals.
Your test execution job in jenkins(master) machine can be made dependent on the job which goes to success when new build is available. As soon as new build is available - that job goes to success then your Test job gets notified and connects to UFT execution machine(slave) and starts running your test.
I am trying to integrate ALM with jenkins but not working
Started by user admin
Running as SYSTEM
Building in workspace C:\JENKINSHOME\workspace\CLRP_AUTO_RN
[CLRP_AUTO_RN] $ C:\JENKINSHOME\workspace\CLRP_AUTO_RN\HpToolsLauncher.exe -paramfile props05092020010832244.txt
"Started..."
Timeout is set to: -1
Run mode is set to: RUN_PLANNED_HOST
Unable to retrieve test set folder: Node not found.
Node not found.
Starting test set execution
Test set name: CLRP Smoke Test Automation Run, Test set id: 104
Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
Could not create scheduler, please verify ALM client installation on run machine by downloading and in installing the add-in form: http://almserver:8080/qcbin/TDConnectivity_index.html
Build step 'Execute Micro Focus functional tests from Micro Focus ALM' changed build result to FAILURE
Finished: FAILURE

Resources