i got a problem i am using p-tableCheckbox and I want to click it using Cypress
i tried cy.get('[id="pr_id_2-table"]').find('div').contains('role="checkbox"').click();
but it's not working any help is heighly appreciated
i got a problem i am using p-tableCheckbox and I want to click it using Cypress
i tried cy.get('[id="pr_id_2-table"]').find('div').contains('role="checkbox"').click();
but it's not working any help is heighly appreciated
most probably this will work
cy.get('#pr_id_2-table [role="checkbox"]').click();
.contains()
is for finding text, but role="checkbox"
is an attribute.
You should search for it with square brackets, same way as [id="pr_id_2-table"]
but using .find()
to search inside the previous subject.
cy.get('[id="pr_id_2-table"]')
.find('div')
.find('[role="checkbox"]')
.click()