Skip to main content
Transform your testing process with: Real Device Features, Company-wide Licences, & App Percy

Filter Test Cases

By default, all the test cases from an XCUI test-suite are executed. However, you can specify selected classes or tests to be executed in any build. These options can be useful in multiple scenarios :

  1. Run a quick smoke test to ensure the sanity of important functionality.
  2. Run only those test cases that are relevant to a new bug fix.
  3. Split a large test-suite into multiple shards and run them in parallel.

In order to do so, you need to pass relevant parameters in the API request to start the XCUI test execution. These parameters are outlined in the table below.

REST API endpoint :

POST /app-automate/xcuitest/v2/build
Parameter Description Values
only-testing Specify the selected classes or tests to be executed in the build A list of fully qualified class/test name
Example: ["SampleXCUITestsClass/testAlertTest"]
skip-testing Skip particular classes or tests from testing in the build A list of fully qualified class/test name
Example: ["SampleXCUITestsClass/testAlertTest"]

Example cURL requests :

Execute particular test cases(from your test-suite) belonging to any class or execute all test cases of a class :

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/xcuitest/v2/build" \
-d '{"only-testing": ["SampleXCUITestsClass/testAlert", "SampleXCUITestsClass/testText"], "devices": ["iPhone 8 Plus-11.0"], "app": "bs://f5L3azt9pLzE995f49376eb1fa3c284dc321f8d", "testSuite": "bs://6eb1fa3c284ddbe9971b2d1aee0d52943b9c081"}' \
-H "Content-Type: application/json"


You can skip certain specific test cases(from your test-suite) belonging to any class or skip all the test cases of a class:

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/xcuitest/v2/build" \
-d '{"skip-testing": ["SampleXCUITestsClass/testAlert"], "devices": ["iPhone 8-11.0"], "app": "bs://f5L3azt9pLzE995f49376eb1fa3c284dc321f8d", "testSuite": "bs://6eb1fa3c284ddbe9971b2d1aee0d52943b9c081"}' \
-H "Content-Type: application/json"

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

Is this page helping you?

Yes
No

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!

Talk to an Expert
Download Copy