I got this web page to test claim number. But I am not able to extract the same.
<h1 class="jss41 undefined" style="text-transform: capitalize; display: flex; align-items: center; margin-bottom: 0.5rem;">
"Claims #"
"75078"
</h1>
The xpath I am trying to get is
export const getClaimsHeader = () => cy.xpath("//h1[contains(@class,'undefined')]")
This is the code I am trying to get the claim Number
getClaimsHeader()
.each((header) => {
claimNum = header.text().split('#');
actualClaimNumber = claimNum[1];
})
.then(() => {
expect(claimNumber).to.equal(actualClaimNumber);
});
But actualClaimNumber
is displayed as blank because header.text()
is returning only "Claims #"