Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88854

How to write variable values on text file or Excel file in Cypress.io?

$
0
0

Does anyone know how I can write the variable values on Text or Excel sheet? I have variable tex and it stores the string values and i want to write those values on textfiles or Excel sheet( preferable)

beforeEach(() => {
    cy.visit('https://docs.cypress.io/api/commands/closest.html#Syntax')
  })
it('go to the home page', () => {
  cy.get('.sidebar-link').each(($el, index, $list) => {
    const tex = $el.text()
  cy.writeFile('/Users⁩/⁨Desktop⁩/2.txt', tex) // <= This piece of code is printing only last stored value
  })
});

I know there is cy.writeFile but not sure how i can use it.


Viewing all articles
Browse latest Browse all 88854


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>