The Relationship between Selenium and the DOM

A very good question now would be why it is important to understand the basic structure of the DOM. Selenium can only interact with the same elements that a real user can interact with. This means that if a real user cannot click or type on an element, Selenium won't be able to either. Selenium and the DOM connect to each other through the elements present in the DOM. To create a healthy relationship between the two, elements should be clear and easily identifiable. Nowadays, web applications have a DOM that is generated dynamically (or simply, with a complex structure), and it is not possible to find a good locator without first understanding the DOM's structure. For example, identifying when one element is the child of another easily reachable element can simplify our tasks.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.34.224