Reputation: 1
I'm new to Cypress, I want to know how to write data to xlsx file, I tried writing this way but it can't open xlsx file.
cy.writeFile('cypress/fixtures/DataTest/login_result.xlsx', '\nUsername : ' + Username + '\n' + '\nPassword : ' + Password + '\n' + '\nExpectedResult : ' + ExpectedResult + '\n' + '\nActualResult : ' + Asresult + '\n' + '\nResult :' + result + '\n').as('writeXlsxFile')
Upvotes: 0
Views: 1155
Reputation: 21
Consider the extension of the Excel file as xls. For example, in the code below, the word Hello is written in the Excel file
cy.writeFile('cypress/fixtures/Test.xls', 'Hello','UTF-8')
Upvotes: 1