5

We have a web application that we want to start running regression tests on, and one of the things I'm supposed to look for when choosing an alternative is a tool that has a recorder. However, I get the general feeling that it is frowned upon, and that writing tests in code is preferred. What are the eventual disadvantages or advantages of using a record and playback tool for regression testing?

2 Answers 2

8

I would not recommend record and play for regression testing for following reasons

  1. The tests would record un-necessary steps depending upon the level of recording present in tool. e.g In some applications selecting a combobox would be recorded as clicking it first and then selecting it. Sometimes it might be desirable sometimes not.
  2. The objects might get duplicated and unorganized making the test very difficult to maintain.
  3. Anyway to implement the logic and iterations you need to come down to code.
  4. You know what you are doing exactly when hand-coding the test.

I would say its like hand coding a website even though you have a WYSIWYG editor at your disposal. For learning and beginning with a tool and see its constructs you can use record and play but to make stable, maintainable and standard based tests you should hand code it taking help of record functionality if required.

The advantages would be

  1. Easy for beginners. Takes less time to get started.
  2. Faster test development (though eventually maintenance and debugging time would over-weigh this advantage)
  3. Cool to demo to your manager to persuade him to buy the licenses. :)
1
  • 3
    Another serious disadvantage is that they are very fragile. Just the simplest change to the application often breaks a dozen tests, even though the application still works as intended.
    – Pete
    Commented Jan 4, 2012 at 9:52
2

For web applications, most recorders translate clicks to XPath queries which are position based or CSS selectors which use only class names or ID attributes, so when the DOM structure changes, the tests have to be rewritten. This forces you to either rewrite the underlying code generated by the tool, or to assign ID attributes to every important element.

References

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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