Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

BrowserStack supports several different ways to control test data, but they solve different problems. For an Android Espresso test that needs a controlled API response, use App Automate’s mock-server option and enable allowDeviceMockServer: true on the build. To repeat a UI test with different input values, use Low Code Automation datasets. To reuse data in planned test runs, use Test Management datasets; to feed virtual users, use Load Testing external inputs. These workflows are not interchangeable, and the mock-server setting has an important trade-off: BrowserStack says Local Testing, Network Logs, and IP geolocation do not work while it is enabled.

First decide what you mean by “mocking test data”

Mocking usually means replacing a dependency with controlled data, but in BrowserStack documentation the phrase can point to several testing layers. A mock server changes the API response an app receives. A data-driven test repeats a UI flow using rows of input. Test Management datasets associate reusable rows with test cases. Load Testing external inputs provide values to virtual users. Requestly is a separate route for modifying browser/API requests and responses.

Workflow Use it when Input model Important constraint
App Automate Espresso mock server An Android Espresso test needs a controlled API response rather than the real remote response. The app request receives a response configured by the test’s mock server. Enable allowDeviceMockServer; Local Testing, Network Logs, and IP geolocation are unavailable while it is enabled.
Low Code Automation data-driven testing You want to run the same UI test against multiple input records. CSV upload or a database-created dataset; cloud execution runs per row. One dataset per test, up to 100 rows and 40 columns; each row is a separate execution.
Test Management datasets You want reusable data associated with test cases and selected run configurations. Select rows from one or more datasets. Multiple selected datasets combine as a Cartesian product, and configurations multiply the run count.
Load Testing external inputs You need CSV or JSON values across load-test virtual-user iterations. External files or reusable project test data; frameworks consume injected values. Mapping defaults and hybrid-load-test support are not consistent across the official pages available for this feature; verify current documentation or UI.
Requestly You need browser-oriented request or response modification. Product-level API mocking and request/response modification capabilities. The overview establishes capabilities, not a complete rule-creation procedure.

Mock an API response in an Espresso App Automate test

Use this path when the behavior under test depends on an API response and you want a known response instead of relying on the live service. BrowserStack’s documented workflow is specifically for Espresso in App Automate; it should not be generalized to every BrowserStack mobile framework. The mock web server accepts the app request and returns the response configured for the test. BrowserStack warns that omitting the enabling parameter can lead to a 503 error when a mock server is used.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set the build option

  1. Configure the mock web server and response in the Espresso test using your app’s test setup.
  2. When submitting the Espresso build request to App Automate, include allowDeviceMockServer: true in the build request payload. Consult BrowserStack’s current Use mock servers page for the request format and any current prerequisites; the key documented setting is the boolean parameter.
  3. Run the test and assert the app behavior that should follow from the configured response. Keep assertions focused on the behavior, not merely on whether the mock server started.
  4. If the test requires BrowserStack Local, Network Logs, or IP geolocation, plan a separate run without this setting: BrowserStack documents those capabilities as unavailable when device mock-server use is enabled.

Do not treat this flag as a general switch for mocking all network traffic or as proof that a particular API response was served. The supplied BrowserStack guidance establishes the Espresso mock-server path and its setting, but does not provide a universal response-authoring recipe for every app architecture.

Run Low Code Automation against multiple data rows

Choose Low Code Automation data-driven testing when the steps stay the same but the values change—for example, a form test that should be repeated for several input records. BrowserStack documents two ways to create the dataset: upload a CSV file or create the dataset from a database. The guide supports public MySQL and PostgreSQL database connections.

Prepare the data and execute

  1. Create or upload a dataset containing the columns the test steps need. The documented limits are one dataset per test, up to 100 rows and 40 columns.
  2. Import dataset columns into the test steps and select the rows that represent the cases you intend to cover.
  3. During authoring, the test runs with the first data row. In cloud execution, BrowserStack runs the test once for each row.
  4. Review execution usage before increasing row count: each row is a separate execution and counts toward test execution usage.

If using a database dataset under concurrency, BrowserStack advises checking that the database can handle the expected connection load. This matters because increasing parallel work can increase pressure on the external database as well as the test service.

Use reusable datasets in Test Management

Test Management datasets are for associating reusable data with test cases, rather than replacing an app’s API response. BrowserStack’s documentation says this feature is available on Pro plan and above. Select the rows needed for the intended run instead of selecting every available value by default.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When rows from multiple datasets are selected, the combinations form a Cartesian product. If one dataset contributes a selected rows and another contributes b, those datasets alone create a × b combinations. Selected browser/OS run configurations multiply that count further. For example, selecting 4 rows from one dataset and 3 from another produces 12 data combinations before configurations are applied. Add configurations only when those combinations are relevant to the coverage goal.

Supply external data to BrowserStack Load Testing

BrowserStack documents CSV and JSON external inputs for browser and API load tests, plus a project-level Test Data Library for reusable files. The data-mapping concepts described include sequential consumption (read rows in order, then loop) and random selection (a row can recur), with assignments that can vary by scenario. Browser frameworks such as Playwright, WebdriverIO, Nightwatch, and Selenium read and parse injected files themselves; protocol frameworks use their native or standard-library mechanisms.

There is a material documentation discrepancy to account for before building a test: BrowserStack’s official pages conflict on whether Hybrid Load Tests are supported and on which mapping mode is the default. Do not assume either hybrid compatibility or a default mapping mode from those conflicting statements. Check the current Load Testing page and the controls in your project before relying on either behavior. Framework parsing also means that attaching a file is not, by itself, enough: the test script must read the injected data in the format and manner expected by that framework.

When Requestly is the better fit

BrowserStack’s Requestly overview describes API mocking, response modification for edge-case testing, request-body modification, request redirection, and header changes. That makes it relevant when the objective is to alter browser/API traffic for testing or debugging rather than to supply rows to a Low Code Automation test. The overview does not establish a full rule-creation walkthrough, so use Requestly’s current detailed API-mocking guide for implementation steps rather than inferring exact menus or fields from the feature summary.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Plan test volume before expanding the data

Data breadth affects how much test work is created. In Low Code Automation, every selected row is a separate cloud execution. In Test Management, selected rows across datasets multiply, then run configurations multiply again. In Load Testing, external data is consumed according to the framework and configured mapping, so inspect how the script reads and reuses values. Choose data that corresponds to a distinct risk or scenario; adding redundant rows can increase executions without improving the answer the test provides.

Troubleshoot common failures

  • Espresso test reports a 503 while using a mock server: confirm the App Automate Espresso build request includes allowDeviceMockServer: true, as BrowserStack warns that the mock-server use can fail without it.
  • Local Testing, Network Logs, or IP geolocation is unavailable: check whether the mock-server flag is enabled. BrowserStack says these capabilities do not work in that mode; run a separate test configuration if they are essential.
  • Low Code test only appears to use one data row: distinguish authoring from cloud execution. The documented authoring run uses the first row, while cloud execution runs once per row.
  • A data-driven run is larger than expected: count selected rows and, in Test Management, multiply selected row counts across datasets and then by selected configurations.
  • A database-backed dataset struggles under concurrency: verify that the public MySQL or PostgreSQL database can sustain the expected connection load, as BrowserStack advises.
  • Load-test values repeat or appear in an unexpected order: inspect the configured mapping and the framework’s parsing logic. Do not rely on a presumed default because BrowserStack’s returned documentation conflicts on defaults.
  • Hybrid load test behavior is unclear: confirm current support in the project UI or current official documentation; the official pages available for this topic disagree.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo is a separate option for capturing website screenshots through an API; it does not mock API responses or replace BrowserStack test datasets. A single GET request returns an image or PDF. For example, cURL:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. It accepts cookie/consent banners and removes 60+ known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and response headers indicate the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

FAQ

Does the Espresso mock-server setting apply to every BrowserStack mobile framework?

The documented guide is specifically for Espresso in App Automate; it does not establish a universal mobile-framework setting.

Can I use a CSV dataset to mock an API response?

The Low Code Automation CSV workflow supplies rows to test steps; the Espresso mock-server workflow controls app API responses. They address different layers.

Does BrowserStack specify a settled default for Load Testing data mapping?

The official pages available for this topic conflict on the default, so check the current project controls instead of assuming one.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.