Great explanation on the difference between POM and 'Data Driven' Object Repository
Testing Drupal all but requires POM due to the challenging element selector requirements & the need for multiple actions against the element/page to access it or interact with it.
Namely CKEditor injects an iframe inside a textarea and the need for JavaScriptExecutioner to update the text() of the embedded body tag.
Even more challenging is the ids of the Admin Form for Content types where there can be multiple values for a field. The id changes when clicking 'Add Another Item' and a hash code is appending to all elements - so the 1st value's element id changes after clicking the add another button. Handling this is easy by requiring an integer for the element's 'getElement' method so the test script can easily identify ANY of the values associated with the field. A Drupal object repository is easily in the thousands - so adding 10 serialized element selector IDs in the Repo for all the Content Authoring fields could easily result in tens of thousands of selectors.
Lastly, it was pointed out that when pages or their elements change, the resulting failures/logs will point to the EXACT area that needs updating. Otherwise, one must scour the OL to locate the id of the element causing failure.
https://www.techbeamers.com/page-object-model-vs-properties-file-in-selenium-webdriver/
- Log in to post comments