
Creating shared steps in Azure DevOps can be a game-changer for your testing process. By defining reusable steps, you can simplify your test automation and reduce maintenance efforts.
To start, you'll need to create a new file in the root of your test project, typically called "shared steps." This file will contain all your reusable steps, which can then be imported into your test cases.
This approach allows you to keep your test cases organized and focused on the specific test scenario, while your shared steps handle the common, repetitive tasks.
You might enjoy: Azure Storage File Share
Benefits of Using Shared Steps
Shared steps in Azure DevOps can be a game-changer for your workflow.
They allow you to reuse existing steps in multiple pipelines, saving you time and effort. You can create a shared step by clicking on the "Add an action" button in your pipeline and searching for the "Shared Steps" option.
This feature is especially useful for teams with multiple pipelines that require similar steps, such as testing or deployment. By reusing shared steps, you can ensure consistency across all your pipelines.
You can also use shared steps to decouple your pipeline logic from your build and deployment steps, making it easier to manage and maintain your pipelines.
Consider reading: Azure Migration Steps
Creating Shared Steps in Azure DevOps

Creating shared steps in Azure DevOps can be a game-changer for your team's productivity.
You can create shared steps by using the "Shared Steps" feature in Azure DevOps, which allows you to reuse steps across multiple test cases.
Shared steps can be saved and reused across multiple test cases, reducing maintenance and increasing efficiency.
To create a shared step, you can use the "Add Shared Step" button in the test case editor, and then select the steps you want to share from the "Shared Steps" library.
Azure DevOps allows you to create multiple shared steps and organize them in a hierarchical structure, making it easy to find and reuse them.
Prerequisites for Creating Shared Steps
To create shared steps in Azure DevOps, you need to have a basic understanding of Azure Pipelines and the concept of shared steps.
First, you need to have a pipeline that contains the steps you want to share. This pipeline can be a build pipeline or a release pipeline, but it must be in a valid state.

You should also have a good understanding of the tasks and variables involved in your pipeline. This will make it easier to identify the steps that can be shared.
The pipeline must have at least one task that you want to share, and the task must be in a valid state.
Having a clear understanding of your pipeline's requirements and dependencies is crucial for creating shared steps.
You should also have a good understanding of the Azure DevOps service connections and how they are used in your pipeline.
Here's an interesting read: Create Task Group Azure Devops
Step 1: Create a Shared Step
To create a shared step in Azure DevOps, you'll need to navigate to the "Pipelines" section, where you can find the "Shared Steps" tab.
Shared steps can be created from the "Shared Steps" tab, which is where you'll find a list of existing shared steps.
Each shared step can be edited, deleted, or cloned, giving you flexibility in managing your shared steps.

To create a new shared step, click the "New step" button, which will prompt you to select a template or create a new step from scratch.
Shared steps can be used across multiple pipelines, making them a great way to reuse code and streamline your workflow.
You can also use the "Add step" button to add a new step to an existing shared step, allowing you to build complex workflows.
Shared steps can be organized into folders to keep them organized and easy to find.
To create a new folder, click the "New folder" button, which will prompt you to enter a name for the folder.
Readers also liked: Azure Create New Organization
Organizing Shared Steps for Easy Access
You can categorize your shared steps in Azure DevOps to make them easier to find and use. This can be done by creating folders and subfolders within the Shared Steps section.
Shared steps can be organized using folders and subfolders, just like you would organize files on your computer.
To create a new folder, click on the "+" icon next to the Shared Steps section header.
This will create a new folder where you can store your shared steps. You can then add steps to this folder by dragging and dropping them from the Shared Steps section.
By using folders and subfolders, you can keep your shared steps organized and make it easier to find the one you need.
Recommended read: Azure Devops Create New Area
Configuring and Managing Shared Steps
To configure shared steps in Azure DevOps, you need to create a new shared step in the Shared Steps section of your project. This is where you define the reusable code snippets that can be used across multiple pipelines.
You can add a new shared step by clicking the "Add" button and then selecting the type of step you want to create, such as a PowerShell or Bash script. Shared steps can be used to perform tasks like installing dependencies, setting environment variables, or running specific commands.
To manage shared steps, you can edit or delete them as needed. You can also reorder the steps to change the order in which they are executed. This is useful if you need to perform certain tasks before others.
Worth a look: What Is Azure Devops Used for
Step 2: Configure the Shared Step

Now that you've created a shared step, it's time to configure it for optimal use.
To begin, you'll want to specify the step's trigger, which can be a specific event or a schedule. This trigger determines when the step will be executed.
Next, you'll need to choose the step's status, which can be either "enabled" or "disabled." If the step is enabled, it will be executed when its trigger is met, but if it's disabled, it won't be executed even if the trigger is met.
The step's permissions also need to be configured, which determines who can view and edit the step. This is especially important if you're sharing the step with a team or organization.
You can also set up notifications for the step, which will alert you and others when the step is executed or fails. This helps ensure that everyone is informed and can take action if needed.
Finally, you can add tags to the step, which makes it easier to search and categorize shared steps in your organization.
Explore further: Azure Devops Trigger Batch
Editing and Updating Shared Steps

Editing and updating shared steps is a straightforward process that requires some basic knowledge of how shared steps work.
To edit a shared step, you need to go to the step's settings page, where you can make changes to the step's description, tags, and other details.
Editing a shared step does not affect the steps that have already been executed by other users.
You can also update the step's status, such as changing it from "draft" to "published".
Updating a shared step will automatically update the steps that have not yet been executed by other users.
Make sure to save your changes after editing or updating a shared step.
Deleting Shared Steps
Deleting Shared Steps can be a bit tricky, but it's a necessary part of keeping your shared steps organized.
To delete a shared step, you'll need to go to the Shared Steps page, select the step you want to delete, and click the "Delete" button.
On a similar theme: Azure Devops Delete Branch

It's a good idea to make sure you have the necessary permissions to delete the shared step, as only administrators or the step owner can do so.
Deleting a shared step will also remove it from any workflows or tasks that use it, so be sure to update those accordingly.
Make sure to communicate with the other users who depend on the shared step, so they can adjust their workflows and tasks as needed.
Consider reading: Azure Pipelines Task
Sharing and Collaborating on Shared Steps
Sharing and collaborating on shared steps is a powerful feature that allows team members to work together seamlessly. This feature is particularly useful when multiple users need to execute the same set of steps.
To share steps with others, you can simply click the "Share" button and enter the email addresses of the team members you want to collaborate with. This will send them a notification with a link to access the shared steps.
If this caught your attention, see: Azure Data Sharing
Shared steps can be edited by all team members with access to them, making it easy to make changes and updates in real-time. This ensures that everyone is working with the most up-to-date information.
You can also assign specific roles to team members, such as "Editor" or "Viewer", to control who can make changes and who can only view the steps. This helps to prevent accidental changes and ensures that the right people are making the updates.
Troubleshooting Common Issues with Shared Steps
If you're experiencing issues with shared steps, the first thing to check is the step permissions. Ensure that the user attempting to access the shared step has the necessary permissions to view or edit it.
A common issue with shared steps is the "step not found" error. This can occur if the shared step is deleted or renamed, but the link to it remains unchanged.
When a shared step is modified, the changes are reflected in real-time for all users who have access to it. This means that any updates made by one user will be visible to all other users who are viewing the shared step.
Recommended read: Azure Devops Basic vs Stakeholder
Make sure that all users who are accessing the shared step are using the latest version of the software. If users are using outdated software, they may experience issues with shared steps, such as being unable to view or edit them.
If you're experiencing issues with shared steps, try checking the step's history to see if any changes have been made recently. This can help you identify the source of the issue and resolve it more quickly.
In some cases, issues with shared steps can be caused by conflicts between multiple users trying to edit the same step simultaneously. To avoid this, consider implementing a locking mechanism to prevent multiple users from editing the same step at the same time.
For more insights, see: Using Vscode for Azure Devops
Sources
- https://learn.microsoft.com/en-us/azure/devops/test/share-steps-between-test-cases
- https://www.browserstack.com/docs/test-management/test-cases/shared-steps
- https://stackoverflow.com/questions/54205131/azure-devops-shared-test-steps-across-organizations
- https://www.linkedin.com/pulse/azure-testplan-drive-collaborated-quality-process-thiruchelvan-2c
- http://help.seapine.com/helixalm/2018.2.0/web/Content/User/TCM/EnteringTestCaseStepsInGridView.htm
Featured Images: pexels.com