Perfecto-Quantum / Quantum-Starter-Kit

Get started with Quantum! Clone or download this repository to start, contains examples of tests and step definitions.
MIT License
58 stars 80 forks source link

not able to read data from Excel in scripts. #32

Closed tarunnmdv closed 4 years ago

tarunnmdv commented 6 years ago

Hi ,

I am facing one issue while reading data from excel in scripts , the data is not in fields and getting below error .

below is the details:- feature file:- Scenario Outline: login Given Open chrome and start application When user enter valid "" Then user enter "" And I scroll down And User should click on NOT NOW button Examples: {'datafile' : 'src/main/resources/data/logindata.xlsx'}

step definition:- @When("^user enter valid \"([^\"]*)\"$") public void user_enter_valid(String Username) throws Throwable { QAFExtendedWebElement userId = new QAFExtendedWebElement("Ecare.inputbox.userId"); userId.clear(); userId.sendKeys(Username);

error getting in console:-

include groups [@login] exclude groups: [] Scanarios location: src/main/resources/scenarios DATAFILE=src/main/resources/data/logindata.xlsx DATAFILE=src/main/resources/data/logindata.xlsx {DATAFILE=src/main/resources/data/logindata.xlsx} {DATAFILE=src/main/resources/data/logindata.xlsx} TestNG: loading csv data file: src/main/resources/data/logindata.xlsx TestNG: loading csv data file: src/main/resources/data/logindata.xlsx TestNG: Missing column header for column[3] in data file: src/main/resources/data/logindata.xlsx. It will be included by lineNo TestNG: Missing column header for column[3] in data file: src/main/resources/data/logindata.xlsx. It will be included by lineNo TestNG: Missing column header for column[3] in data file: src/main/resources/data/logindata.xlsx. It will be included by lineNo TestNG: Missing column header for column[3] in data file: src/main/resources/data/logindata.xlsx. It will be included by lineNo TestNG: Missing column header for column[3] in data file: src/main/resources/data/logindata.xlsx. It will be included by lineNo TestNG: Missing column header for column[3] in data file: src/main/resources/data/logindata.xlsx. It will be included by lineNo TestNG: Missing column header for column[4] in data file: src/main/resources/data/logindata.xlsx. It will be included by lineNo TestNG: Missing column header for column[4] in data file: src/main/resources/data/logindata.xlsx. It will be included by lineNo TestNG: Missing column header for column[5] in data file: src/main/resources/data/logindata.xlsx. It will be included by lineNo TestNG: Missing column header for column[3] in data file: src/main/resources/data/logindata.xlsx. It will be included by lineNo TestNG: Missing column header for column[5] in data file: src/main/resources/data/logindata.xlsx. It will be included by lineNo TestNG: Missing column header for column[3] in data file: src/main/resources/data/logindata.xlsx. It will be included by lineNo

kulin24 commented 6 years ago

It seems that your excel is some values in column 3, 4 & 5 but no colomn name is given for them. Please make sure that you delete all the cells from these columns and try again.