There is a lot of choice about specific tools and technology to use for UI automation for User Acceptance tests.

What are good practices that should be considered in the architecture of UI automation for user acceptance testing ?

  • 2
    How do you feel about taking this to a community wiki post? I think it would be a valuable resource even though it's technically too broad for this forum.
    – Kate Paulk
    Commented Aug 1, 2017 at 11:39
  • Sure. How to do that? I have flagged it for that Commented Aug 1, 2017 at 21:38

1 Answer 1


Good practices for UI test automation

  • Technical Excellence for clean code and TDD
  • Write human readable tests as documentation
  • Keep tests DRY with helpers for repeated steps
  • Use a BDD approach such as Given, When, Then
  • Perform javascript unit testing with HTML fragments
  • Ensure that Happy, Sad and Optional paths are tested
  • Use Page Data Objects for data being entered on a form
  • Use a headless browser for browsers tests when possible
  • Use a Distributed Version Control System to store test code
  • Examine unit testing to understand what is covered by them
  • Make sure to use a set of wait strategies to deal with devices
  • Use of strategies for speed such as session control management
  • Knowledge and skill level required / available to maintain test code
  • Allocate sufficient time and resources for fixing intermittent failures
  • Use a separate test database, reset / rolled back after each test run
  • Perform user acceptance testing with selenium and a language binding
  • Use a Continuous Integration Server to allow for parallel running of tests
  • Allow multiple assertions to address the speed issue of running in browsers
  • Only run in different devices if you have experienced browser specific issues
  • Use Page Objects for element selectors, actions and services (sets of actions)
  • 1
    Comprehensive, well done. Can you please elaborate on "Allow multiple assertions to address the speed issue of running in browsers"?
    – Yu Zhang
    Commented Aug 1, 2017 at 4:29
  • 1
    One normally does on assertion per test as a good practice. However browser tests can be very slow, especially the ones that bring up a real browsers. If there are 20 assertions, bringing up 20 browser window instances will be slow. For example you enter data in 20 fields on a form and then you need to verify that if the form was submitted with an error those 20 fields have retained their values. In cases like this, mostly because of browser speed if all those assertions are just put in one test. Also 20 assertions are more readable than the hundreds of lines needed to have each one alone Commented Aug 1, 2017 at 21:36
  • Using DVCS is a good practice for UI testing? Not VCS but specifically DVCS? Using BDD with Given/When/Then is a good practice? Hm... Very opinionated answer. Commented Aug 16, 2017 at 6:35
  • Yes, the Version Control System should be distributed so that more than 1 person can work on the code and can do so disconnected from the internet, e.g. git. BDD using given when then helps avoid programmers who start creating "given when then when then when then". I've learned the above from multiple experiences at different companies and I stand by my opinion. Commented Aug 16, 2017 at 10:08

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.