Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I am in a situation where I have to revert all the changes which I made while testing the application. Is there any way of doing this in Testng?

Suppose if I have added something into the application during testing add functionality. now when I am tearing down this test case, I have to revert the changes. Any suggestions how to do this?

If I have deleting functionality then I can delete that added thing in tear down. but that would be a kind of test case for delete functionality into a tear down process. isn't it?

Also if we don't have any delete functionality then. Anyone who knows how to revert the changes, please suggest.

I am taking selenium webdriver and testng in use.

share|improve this question

2 Answers 2

Like Josa Pita says, that is nothing for testing frameworks itself.

The developers could write a script to save the current version of the DB. The process should look like that:

  1. Save current version of DB/any kind of data storage.
  2. Start test run.
  3. After test run finished restore the saved version of the DB/any kind of data storage.

But I think it is only a solution for Applications with not too big databases/any kind of data storage. You also could have troubles with manual tests while the test run.

But the best solution would be a own test environment with a own database/any kind of data storage. Also talk to the developers. Tell him your trouble and find a solution together.

share|improve this answer

From what I understand from your question, you want to delete the records of the actions you made on your app?

This has nothing to do with selenium or testng, you need to have an app for tests only, with a clean DB, that you can delete the records from your actions.

Is this helpful?

share|improve this answer
    
I don't have DB's. I just run my tests on projects deployed on server. –  razizcool4all Jul 2 at 9:58
    
So you can't revert any changes you made? –  Jose Pita Jul 2 at 13:25
    
thats what.. I don't have access to DB.. at most I can write revert test functions which will perform operation to change what I did in testing process. but here also a problem is there that suppose application has just adding facility then once i add i can't revert. –  razizcool4all Jul 22 at 12:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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