I would like to set up tests for a web site created with a page designer tool. I have some, but by no means complete, control over where attributes appear in a page. In particular, I would like a test to find an element with a certain id; check that the text of that element is correct; and check that the link for that element is correct. I want to log the result of each test—test passed or test failed.
Here is a snippet of the code I want to test:
<div class="elementor-element elementor-element-mzigegu elementor-widget elementor-widget-heading" data-id="mzigegu" data-element_type="widget" id="syllabus" data-widget_type="heading.default">
<div class="elementor-widget-container">
<h5 class="elementor-heading-title elementor-size-medium">
<a href="/syllabus-kanban-foundation-training-knowledge-work/" target="_blank">Course syllabus</a>
</h5>
</div>
</div>
My issue is as follows. I am able to use the storeText command to get the displayed text for a given id (in the above case, id=“syllabus”). However, the storeAttribute command is unable to find the href associated with that id. Unlike the storeText command, which apparently looks at all the embedded tags to find text, storeAttribute apparently does not look far enough to find the href. So, my question is how to find the href value in the above example and store it in a variable.