Integration · Test framework · via REST API
Selenium's own docs say not to use the browser to set up test data, and to use APIs instead. A session fixture can call the Synthesized REST API, refresh the test database with masked or synthetic data, and only then let the browser tests start.
There is no Selenium plugin; this pattern uses the documented REST API.
| Where the call goes | Your test framework's once-per-run setup: a session-scoped pytest fixture, JUnit @BeforeAll, TestNG @BeforeSuite or NUnit [OneTimeSetUp]. |
|---|---|
| How it connects | Start the workflow with POST /external/api/v1/workflow/{id}/run, then poll GET /workflow-run/{id} until it is final. |
| Configuration | GOVERNOR_URL, WORKFLOW_ID and GOVERNOR_ACCESS_KEY as environment variables. |
| Grid | Runs on the machine that starts the suite, not on Grid nodes. |
| Status | Works through the REST API. Selenium isn't named in the Synthesized docs; the API calls are. |
Create the masking, subsetting or generation workflow that fills your test database, and run it once by hand.
Set GOVERNOR_URL, WORKFLOW_ID and GOVERNOR_ACCESS_KEY in the environment, from your CI secret store.
Add the session fixture below to conftest.py, or the equivalent setup method in your framework.
The fixture refreshes the data once, before the first test. If the run fails, the suite stops.
Python with requests; the same three calls work from Java, C# or JavaScript.
conftest.py
An access key carries the permissions of the Governor user who generated it. Create a user that can reach only the workflows this pipeline runs, generate the key as that user, and give it a short expiry: keys are chosen from 1 hour to a year, and the docs say they can't yet be revoked.
Two runs can't write to the same output database at the same time. If parallel pipelines or branches need data, give each environment its own workflow or output database.
Workers read the source, mask, subset or generate, and write the target. Database contents stay with the workers and aren't sent to Governor, which, like the pipeline, only sees run status, logs and configuration. Run Synthesized on-premises, including air-gapped, and the data never leaves your environment; it is also available as SaaS.
No. Your test framework's setup code calls the Synthesized REST API, so it works with any Selenium setup that can reach your Governor over HTTPS. You need an HTTP client (the example uses Python's requests), the Governor URL, a workflow ID and an access key.
Selenium's own guidance is that it should not be used to prepare a test case: create data through APIs, and keep the browser for the behaviour under test.
Any. The calls are plain HTTPS, so the same pattern fits a pytest fixture, JUnit @BeforeAll, TestNG @BeforeSuite or NUnit [OneTimeSetUp].
Yes. The refresh runs once on the machine that starts the suite; Grid nodes only run the browsers.
runsync is simpler, because one call waits for the run to finish. Polling is safer for long runs, because it doesn't depend on one HTTP request staying open.
Bring one Selenium suite that depends on production-like data, and see Synthesized prepare it before the run.
All product names, including Selenium, are trademarks of their respective owners.