I have a case where locator doesn't have a text value but it's attribute named title has a text value that I need to assert. While writing custom locator for it I can only get the text value which is "" and not specific attribute value say title = "#abcdd".
Example:
<div class="table-cell" role="cell" table-field= "risk" title="high">high</div>
Has high
as value which I can get
Whereas,
<div class="table-cell" role="cell" table-field= "colour" title="#abcdd"></div>
Doesn't have any text value but need to get title attribute value #abcdd
in this case.
Need a generic code to get all such title attribute values present inside this table. Where are the things going wrong? Any way I can handle this? Or that text value needs to be included in html?
Using karate as Automation test tool.