A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/en-us/azure/devops/test/run-automated-tests-from-test-hub below:

Run automated tests from test plans - Azure Test Plans

Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019

Automate test cases in your test plans and run them directly from Azure Test Plans. Automated tests provide you with the following benefits:

Prerequisites Category Requirements Access levels - At least Basic access, with permissions to view work items under the corresponding Area Path.
- To add test plans and test suites, delete test artifacts, and define test configurations: Basic + Test Plans access.
Or, one of the following Visual Studio subscriptions:
- Enterprise
- Test Professional
- MSDN Platforms Permissions - To add or modify test plans, test suites, test cases, or other test-based work item types: Edit work items in this node permission set to Allow under the corresponding Area Path.
- To modify test plan properties such as build and test settings: Manage test plans permission set to Allow under the corresponding Area Path.
- to create and delete test suites, add and remove test cases from test suites, change test configurations associated with test suites, and modify a test suite hierarchy (move a test suite): Manage test suites permission set to Allow under the corresponding Area Path.
- Permissions to create and manage releases, edit a release environment, and manage deployment. For more information, see Release permissions Tools and configurations - A test plan that contains your automated tests associated with automated test methods using Visual Studio 2017 or Visual Studio 2015 or earlier.
- A build pipeline that generates builds containing the test binaries.
- An app to test. You can deploy the app as part of the build and release workflow and also use it for on-demand testing. Set up your environment
  1. In the Test Plans page, choose your test plan, open the shortcut menu, and then select Test plan settings.

  2. In the Test plan settings dialog, select the build pipeline that generates builds that contain the test binaries (both, Classic and YAML build pipelines are supported). You can then select a specific build number to test, or let the system automatically use the latest build when tests are run.

  3. You need a release pipeline that was created from the Run automated tests from Test Manager template to run tests from test plans in Azure Test Plans. If you have an existing release pipeline created using this template, select it and then select the existing stage in the release pipeline for the test execution (both, Classic and YAML release pipelines are supported). Otherwise, select Create new in the dialog to create a new release pipeline that contains a single stage with the Visual Studio Test task already added.

    How do I pass parameters to my test code from a build or release pipeline?

  4. Assign meaningful names to the release pipeline and stage as required.

  5. If Visual Studio is already installed on the agent computer, skip this step. If not, add the Visual Studio Test Platform Installer task to the pipeline definition.

  6. Add the Visual Studio Test task to the release pipeline and configure it as follows:

    For information about the option settings of the Visual Studio Test task, see Visual Studio Test task.

  7. Choose the Agent job item and verify that the deployment queue is set to the one containing the machines where you want to run the tests. If your tests require special machines from the agent pool, you can add demands that select at runtime.

    You might be able to minimize test times by distributing tests across multiple agents by setting Parallelism to Multiple executions and specifying the number of agents.

    Note

    If you're running UI tests such as CodeUI or Selenium on physical browsers such as IE, Firefox, or Chrome, the agent on the machines must be running in interactive mode and not as a service. More details.

  8. In the Pipeline page of the release pipeline, verify that the build pipeline containing the test binaries links to this release pipeline as an artifact source.

  9. Save the release pipeline.

  10. If you chose Create new in the Test plan settings dialog in step 2 of this example, return to the browser page that contains your test plan settings. In the Test plan settings dialog, select the release pipeline and stage you saved.

Run the automated tests
  1. In the Test Plans web portal, open the test plan and select a test suite that contains the automated tests.

  2. Select the test case(s) you want to run, then click on Run for web application.

    The test binaries for these tests must be available in the build artifacts generated by your build pipeline.

  3. The system checks that only automated tests get selected (any manual tests are ignored), validates the stage to ensure the Visual Studio Test task is present and has valid settings, checks the user's permission to create a release for the selected release pipeline, creates a test run, and then triggers the creation of a release to the selected stage.

  4. Select View test run to view the test progress and analyze the failed tests. Test results have the relevant information for debugging failed tests such as the error message, stack trace, console logs, and attachments.

  5. After test execution is complete, the Runs page of the Azure Test Plans shows the test results. The Run summary page shows an overview of the run.

    There's a link to the Release used to run the tests, which makes it easy to find the release that ran the tests if you need to come back later and analyze the results. Also use this link if you want to open the release to view the release logs.

Note

Manually attachment of files isn't supported for automated test results.

What are the typical error scenarios or issues I should look out for if my tests don't run?

  1. The Test results page lists the results for each test in the test run. Select a test to see debugging information for failed tests such as the error message, stack trace, console logs, and attachments.

  2. In Test Plans go to the Runs page where you can find an overiew of all your test runs. From here, you can open the detailed view of each test run.

FAQ

See the following frequently asked questions (FAQs) about Azure Test Plans.

Q: What permissions do I need to run automated tests from Azure Test Plans?

A: Be a Project Contributor, or have the following permissions:

For more information, see Release permissions.

Q: Can I override the build or stage set at the test plan level for a specific instance of test run?

A: Yes, you can do this using the Run with options command. Open the shortcut menu for the test suite in the left column and select Run with options.

Enter the following values in the Run with options dialog and then select OK:

Q: Why use release stages to run tests?

A: Azure Pipelines offers a compelling orchestration workflow to obtain test binaries as artifacts and run tests. This workflow shares the same concepts used in the scheduled testing workflow, meaning users running tests in scheduled workflow find it easy to adapt; for example, by cloning an existing scheduled testing release pipeline.

Another major benefit is the availability of a rich set of tasks in the task catalog that enable a range of activities to be performed before and after running tests. Examples include preparing and cleaning test data, creating and cleaning configuration files, and more.

Q: How does selecting "Test run" in the Visual Studio Test task version 2 work?

A: The Test management subsystem uses the test run object to pass the list of tests selected for execution. The test task looks up the test run identifier, extracts the test execution information such as the container and test method names, runs the tests, updates the test run results, and sets the test points associated with the test results in the test run. From an auditing perspective, the Visual Studio task provides a trace from the historical releases and the test run identifiers to the tests that were submitted for on-demand test execution.

Q: Should the agent run in interactive mode or as a service?

A: If you run UI tests such as coded UI or Selenium tests, the agent on the test machines must be running in interactive mode with autologon enabled, not as a service, to allow the agent to launch a web browser. If you're using a headless browser such as PhantomJS, the agent can be run as a service or in interactive mode. For more information, see Build and release agents, Deploy an agent on Windows, and Agent pools.

Q: Where can I find detailed documentation on how to run Selenium tests?

A: See Get started with Selenium testing.

Q: What happens if I select multiple configurations for the same test?

A: Currently, the on-demand workflow isn't configuration-aware.

Q: What if I need to download product binaries and test binaries from different builds? Or if I need to obtain artifacts from a source such as Jenkins?

A: The current capability is optimized for a single team build to be tested on-demand using an Azure Pipelines workflow. We evaluate support for multi-artifact releases, including non-Azure Pipelines artifacts such as Jenkins, based on user feedback.

Q: I already have a scheduled testing release pipeline. Can I reuse the same pipeline to run test on-demand, or should I create a new pipeline?

A: We recommend you use a separate release pipeline and stage for on-demand automated testing from Azure Test Plans because:

Q: Can I trigger these runs and view the results in Microsoft Test Manager?

A: No. Microsoft Test Manager doesn't support running automated tests against Team Foundation builds. It only works in the web-based interface for Azure Pipelines. All new manual and automated testing product development investments are in the web-based interface. No further development is planned for Microsoft Test Manager. See Guidance on Microsoft Test Manager usage.

Q: I have multiple testers in my team. Can they run tests from different test suites or test plans in parallel using the same release pipeline?

A: They can use the same release pipeline to trigger multiple test runs in parallel if:

To enable multiple different test runs to execute in parallel, set the Azure Pipelines stage trigger option for behavior when multiple releases are waiting to be deployed as follows:

Q: How do I pass parameters to my test code from a build or release pipeline?

A: Use a runsettings file to pass values as parameters to your test code. For example, in a release that contains several stages, you can pass the appropriate app URL to each the test tasks in each one. The runsettings file and matching parameters must be specified in the Visual Studio Test task.

Q: What are the typical error scenarios or issues I should look out for if my tests don't run?

A: Check and resolve issues as follows:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4