3 ms·
One thing I never quite understood about online testing tools like browserstack and saucelabs is how to reset server state. Most webapps have some kind of data
by aslakhellesoy 15y ago
One thing I never quite understood about online testing tools like browserstack and saucelabs is how to reset server state.
Most webapps have some kind of datastore. Poking around a web ui will CRUD records in that datastore, possibly corrupting the next test. Another problem with this is coupling between tests, making them hard to modify without breaking a bunch of others.
Most automated test setups I have seen run on a local machine, and all server state is reset between each test.
How is this done on browserstack/saucelabs?
- rb2k_ 15y agoI think they just delete the user profile which is where browsers usually save their data. (not 100% sure about that, but I think Selenium mentioned that in the logging output)
- aslakhellesoy 15y agoBy datastore I meant server side database (SQL/NoSQL)
- rb2k_ 15y agoThe way you'd usually do it is either having a multi-user application and just create a new user for a new test (also helps testing concurrently) or you'll have to reset the app by: - redeploying it on a new e.g. EC2 instance - clearing out the database and inserting your original blank state from an SQL dump - clearing out the filesystem by e.g. using a git reset p.s. you should try to have an automated deployment for your product. That way you could also just spin up a new EC2 instance -> deploy -> test -> kill instance