I have below structure.:
<dl class="er-ctrbs-review-totals-list" </dl>
<div data-qa="total-1">
<dt>Employee Name</dt>
<dd>Sam</dd>
</div>
<div data-qa="total-2">
<dt>Employer Name</dt>
<dd>ZenS</dd>
</div>
</dl>
I am trying to get the values of dt and dl. I tried with: page.locator woth [data-qa] attribute but its returning locator only not value.
Then I have tried :
_page.Locator("xpath=//div[@data-qa='total-1']/dt");
_page.Locator("xpath=//div[@data-qa='total-2']/dt");
also with this change:
_page.Locator("xpath=*//div[@data-qa='total-1']/dt");
_page.Locator("xpath=*//div[@data-qa='total-2']/dt");
Can anyone please help me how can I get the label and value under div?
I am trying to get the: Employee Name, Sam, Employer Name, ZenS
You can use the
regeXand take the values of<dt> and<dd>