Ellin Teoh
Ellin Teoh

Reputation: 25

Selector not working with elements with many markups

On this page https://www.storytel.com/se/sv/ljudbockeri want to locate any book cover or title because I want to click on it. However I keep getting the error that it does not match any element in the DOM tree. It does have many markups so maybe that could be the reason. Does anyone know how i can make this work? Thank you

Upvotes: 1

Views: 37

Answers (1)

VysakhMohan
VysakhMohan

Reputation: 567

To click on book with title 'Rött, vitt och kungligt blått', first try saving the div section which contains the book using

const smartList1 = Selector('#smartList1');

Now to click on the specific title 'Rött, vitt och kungligt blått', try

await t.click(smartList1.find('a.sliderBookTitleLink').withText('Rött, vitt och kungligt blått'));

Upvotes: 2

Related Questions