-1

Every time I run my Selenium tests it creates a lot of dummy data in Database. I need a solution where I can stop selenium tests to not update database after the tests are Passed.

For example: I have a Selenium test to create a user so every time I run my whole test suite, it creates a user stores in database.

How do I create a user but not store it in database using Selenium Webdriver ?

VLAZ
  • 26,331
  • 9
  • 49
  • 67
Anu
  • 1

1 Answers1

0

For such cases typically your testcase should cleanup after its' self. meaning you should be using the [TestFixtureTearDown] or [OneTimeTearDown] and ensure any created files/database entries are deleted there.

Other option is to take a database dump before running your tests ultimately in the testfixture setup and revert to it in the teardown.

Hope this helps.

Moe Ghafari
  • 2,227
  • 1
  • 12
  • 17
  • Thank you for your suggestion. Is it possible for you to share an example of code snippet for [TestFixtureTearDown] or [OneTimeTearDown]? – Anu Aug 25 '17 at 09:15