问题
Might be a basic question. But since I am new to protractor, I definitely need some help!
How to read/write from/to an excel using NodeJS - Protractor?
Can someone explain with an example?
My intention is to Parameterize my scripts using NodeJS - Protractor with the help of excel.
回答1:
Protractor has no specific support for Excel itself, but it runs inside Node.JS, so you can use any Node module that works with excel. https://www.npmjs.org/package/excel-parser looks promising.
回答2:
To perform read and write operation on excel sheet we need node application and exceljs library installed.
To install exceljs library type npm install exceljs and [press enter].
Refer below link, it contains code for,
- Add sheet to new excel file
- Add row in new sheet
- Edit existing excel file
- Read data from excel
Links
- Code to perform write operation
- Code to perform read operation
来源:https://stackoverflow.com/questions/26616522/how-to-read-write-from-to-an-excel-using-nodejs-protractor