Angular Application UI Testing

Testing UI of an application can be automated with the Selenium testing framework. The problem by testing of an Angular5 application were random assigned indexes to IDs of HTML elements after each application start (e.g. myid-4), which prevents finding elements by id using Selenium web driver. The finding elements had to be changed and set to finding elements by xpath.

Comments

Good point - even though IDs are often used in HTML, frameworks like Angular or even some lesser known ones like ZK tend to autogenerate (random) IDs (sometimes because of safety reasons). XPath is the way to go here. Some frameworks allow to write own ID generators for testing environments, where a predictable ID is assigned to each element making testing with Selenium less painful.
Artur Marcin Sz... - Sun, 12/09/2018 - 19:26 :::
No answers yet.