2 Replies Latest reply on Nov 12, 2020 11:45 PM by DheerajK_81

    Using cypress filters to pick the text of an element

    evpo_4814691

      Hi everyone,

       

      There's an example of using cypress filters to pick a particular element -

       

      <ul>

        <li>Home</li>

        <li class="active">About</li>

        <li>Services</li>

        <li>Pricing</li>

        <li>Contact</li>

      </ul>

      // yields <li>About</li>
      cy.get('ul').find('>li').filter('.active')

      What can I do if I need to picket the text 'About' instead of the class '.active'?

       

      Thank you.