How to get a first elements value from the table

Viewed 41

Hey guys sorry i have attempted it but could not get it.

static get tableRows(): Cypress.Chainable<JQuery<HTMLElement>> {
    return cy.get<HTMLElement>('tbody[role="rowgroup"] tr');
  }

Above i have located table but i need first located element so first row from the table and column where data stored, then i need that date text to be saved into a const

tableRows.eq(0) but how can i grab a text

enter image description here

any help would be appreciated

Okay i managed to find element but when i do console.log(text) it prints a function instead of text

 TransactionsPage.tableRows.eq(0).find("td.cdk-cell.date.cdk-column-Date.table-cell").then($value =>{
      console.log($value.text)
    })
0 Answers
Related