News for hackers. Stuff that matters.
Re:Cross-Browser Testing Tool Will Rock Your Socks Off by aslakhellesoy on Tuesday September 06, 2011 @02:08AM (#2964373)
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?

Re:Cross-Browser Testing Tool Will Rock Your Socks Off by rb2k_ on Tuesday September 06, 2011 @02:21AM (#2964402)
I 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)

Re:Cross-Browser Testing Tool Will Rock Your Socks Off by aslakhellesoy on Tuesday September 06, 2011 @02:30AM (#2964425)
By datastore I meant server side database (SQL/NoSQL)
Re:Cross-Browser Testing Tool Will Rock Your Socks Off by rb2k_ on Tuesday September 06, 2011 @02:52AM (#2964465)
The 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