2

Looking for some best practice here:

I'm looking to future proof the selenium tests that I'm building. They'll involve shared elements (products/locations/users), and it seems like a bad pattern to be building unique, test specific data for each test in isolation.

So how do I avoid my setup/teardown potentially wrecking other tests?

2

Bootstrap a clean environment for each test to test in isolation. This might look like a lot of overhead, but is very needed if you want to parallel run your tests and not get flickering and possible untrusted tests.

Personally I create a session GUID and then generate test data and store in it in a database with the GUID. Boot an environment and let it point to the dataset. Automating this should already be part of the automated build-pipeline, if not this is a good reason to start working on it :)

Also read my answers to https://sqa.stackexchange.com/a/12225/3201 and https://sqa.stackexchange.com/a/13660/3201 which are about managing testdata and environments.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.