dimanche 24 janvier 2021

TestCafe selector for a Classname with multiple matching nodes

I'm looking for a valid TestCafe selector that finds an element appearing many times in my HTML code with the same class name as follows:

enter image description here

I have tried all the selectors below and it always fail with element not found in the DOM

this.policyretrieve_item2=Selector('.c-text u-text-sm--right  u-weight--600')

this.policyretrieve_item2=Selector('.c-text u-text-sm--right').nth(4)

this.policyretrieve_item2=Selector('.c-text u-text-sm--right')


Then i expect with the following code if the element exist

.expect(this.policyretrieve_item2.exists).ok('Some values after policy search are not displayed', { timeout: config.general.shortTimeout })
   

Aucun commentaire:

Enregistrer un commentaire