The long answer follows.
The majority of times I was involved in a web test automation project, implementing test automation was not easy because the site design was not appropriate. In other words, the site was implemented without thinking on how test automation will be done.
When is the site design not appropriate?
- The site is built with 3rd party libraries by dragging and dropping components on a page and then customizing them. There was no way of adding custom id attributes to HTML elements in these cases. Which lead to using very bad locators for finding elements.
- The site is built with 3rd party components by embedding them in code. There was again no way of adding custom attributes to HTML elements.
- The site uses very long pages instead of multiple small pages. A small page fits much better in the screen than a long one and may not require any scrolling. In contrast, any very long page needs lots of scrolling to see and interact with its elements.
- The site uses scroll bars inside of the page.
- The site does not use distinct title and url for each of its pages. This makes checking that a specific page is displayed more difficult. Instead of just checking if the page title or url is correct, the automation code will have to verify that an element specific to the page is visible.
- The site does not use HTML elements that are appropriate for their use. If an element is supposed to be clicked, then the element should use a tag such as A or BUTTON or INPUT instead of DIV or SPAN.
- The site uses fancy controls that are built fully with CSS. If, for a listbox, the site uses a custom element built in CSS with DIV and SPAN elements instead of the SELECT HTML element, the automation code cannot use the Selenium built-in classes for listboxes. Instead, custom code will be needed for expanding first the listbox and then selecting an option. Other common elements implemented in CSS are sliders, listboxes that use checkboxes as options and date controls.
- The site uses iframes. If an element is included in an iframe that is part of another iframe, before interacting with the element, the code has to switch the driver focus to the first iframe and then to the second one.
- The site uses CAPTCHA on all environments, including the test one. There is no way to automate using a CAPTCHA control.
- The site opens pages in new browser tabs. Interacting with elements of the new page requires switching the driver focus first to the new page.
- The site uses lots of random popups. The random popups make writing automation code difficult because the code needs to handle both the situation when the popup is displayed and also the case when the popup is not visible.
- The site does not display fresh data because there is no process to refreshing the data from the production environment.
- The site uses domain authentication. Before using the site, the automation code needs to log in first.
This is not a complete list.
I just mentioned common things that I see often in the projects that I work on.
If you know of anything else that should be added to the list, please let me know.