I am trying split text that gets printed in the Web application and log just the value in cypress. I just need the number from the text. But seem to to be stuck because the value is not getting printed(Logs are empty) as it is not recognized. Tried various approach but still cant seem to print it. I thought that since I need the numeric value, cypress does not recognize the number since I specified as a text. But I even try to invoke 'val'. The result seems the same.
cy.get('#__label14-bdi').invoke('text').then((text) => {
cy.log(text)
var splittext= text.split('')[1];
cy.log(splittext);
From the above code the letter 'i' is getting printed. Here is a ss of the text from the web application.
