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?
I would not recommend record and play for regression testing for following reasons
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
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.