how to find the first element with selector following an element #19705
Unanswered
justforuse
asked this question in
Questions and Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Take cypress.io as an example, I want to get the first div that following the
h1
element.and I wrote this file:
seems
next
not work as I expected. it give me an error:If I add another
.next()
, it works as expected:cy.get('h1').next().next('div').find('button')
I just wonder is there an api can deal with this situation? because we may not know the number of elements between
div
andh1
.thanks.
Beta Was this translation helpful? Give feedback.
All reactions