Rerun tests on GitLab
Configure the GitLab CI/CD integration so you can rerun failed tests from the Test Reporting & Analytics dashboard.
BrowserStack Test Reporting & Analytics lets you rerun failed tests directly from the dashboard after you integrate GitLab. This removes the need to manually trigger pipelines.
Before you proceed, complete the main setup to rerun failed tests: Rerun failed tests with Test Reporting & Analytics.
To rerun tests from BrowserStack, your GitLab role must have permission to use pipeline variables. To verify, ensure your role is included in Minimum role to use pipeline variables in Settings > CI/CD > Variables.
Configure the GitLab integration
Each user who wants to trigger reruns must complete this setup:
- Go to the GitLab integration page.
- Create a GitLab personal access token. In GitLab, go to User settings > Access tokens > Add new token, set an expiry date, and select only the minimal scope needed to trigger pipelines. The
apiscope is recommended. For details, see GitLab personal access tokens. - Enter the token in the form and click Submit.
- Review the token scopes and remove any you don’t need.
- In your target repository, confirm that the
.gitlab-ci.ymlfile defines a job that BrowserStack can trigger.
Trigger reruns
After you complete the CI configuration, follow these steps to rerun failed test cases:
- Go to the Test listing to view failed test cases.
- Hover over the failed test name to display the action icons.
- Click the rerun icon to open the rerun options.

Related topics
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!