3 ms·
I agree that is is important to structure the application to facilitate testing. But I find this surprising: > And while recorders present some challenges, man
by danidiaz 9y ago
I agree that is is important to structure the application to facilitate testing. But I find this surprising:
> And while recorders present some challenges, manually coding UI-level tests make the maintainability issue an order of magnitude worse.
In my experience, writing the tests manually for sufficiently "regular" applications ends up being more maitainable because you can put repeated logic in shared functions and classes, making it easier to adapt to changes in the GUI. Page Objects are an example of that: https://github.com/SeleniumHQ/selenium/wiki/PageObjects https://github.com/SeleniumHQ/selenium/wiki/PageObjects
Also, writing the tests manually lets you use "explicit waits". http://elementalselenium.com/tips/47-waiting http://elementalselenium.com/tips/47-waiting Specifying exactly what we expect to happen tends to be more robust (and faster) than either using static sleeps or some kind of implicit wait. Recorders tend to have problems finding concrete things to wait for, especially for very dynamic pages.
(That said, I'm not against using something like Chrome DevTools to identify elements in the page, evaluate potential selectors, and so on. That is indeed useful.)