Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

170
Views
extract text with the same name used multiple times

What i want is to check that "ZZ" is showing in the table row considering that i can have other rows with the same "ZZ" in the same cell name.

i have done this so far:

 cy.contains('tr', 'abc...')
            .parent()
            .within(()=> {
                cy.get('td.v-cell').should('have.text', 'ZZ')
        })

I am getting: expected [ <td.v-cell>, 19 more... ] to have text ZZ, but the text was 20%20%5%0%20%-0-20%-20%-ZZ

I have this html: https://i.stack.imgur.com/k224U.png

How do i verify the text even if the text can appear in other rows as well..Also if i change ZZ to 20% it should be getting error as the text is ZZ.

Thank you

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Instead if have.text you can use include.text something like:

cy.get('td.v-cell').should('include.text', 'ZZ')

Assuming abc is a td element, you can do like this:

cy.contains('td', 'abc...')
  .parent()
  .within(() => {
    cy.get('td.v-cell').should('include.text', 'ZZ')
  })

Again assuming that the tr you want to go is the immediate next:

cy.contains('td', 'abc...')
  .parent('tr')
  .next()
  .within(() => {
    cy.get('td.v-cell').should('include.text', 'ZZ')
  })
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!