I have to read excel where excel have employee name,process,start date,end date and employee id columns.In excel,For each employees process is different,(process i have to select from dropdown in UI),start date ,end date.I have to fetch all this details from excel and i have to capture employee id after creation of employee and put back to the excel.How do i do it using cucumber?
Asked
Active
Viewed 303 times
-1
-
The way to do tabular data testing in Cucumber is with a Scenario Outline. You will have to use a custom mechanism to update the spreadsheet. I suggest that if you want to do data-driven testing, you do it outside of Cucumber. – ou_ryperd Oct 16 '19 at 11:30
-
if not using data driven how do i automate this scenario in cucumber?Because for each process you select from dropdown,the next step will be different.scenarios are not constant.Do you want me to use if else condition?if(process equals abc){do xyz) if(process equals def)(do lmn)? – Mangala Hegde Oct 16 '19 at 11:44
-
It doesn't sound like your data as it is and Cucumber are compatible. It is hard to say without seeing what you are trying to achieve. – ou_ryperd Oct 16 '19 at 13:00
-
I have an application where i have to search a member and for the member, i have to assign process(from drop down).But depending on the process I select ,I have to write next step.Ex:for ABC employee if i select XYZ as process,then next step will be clickButton,and simillarly for LMN employee if i select PQR as process,next step will be assignUser.So till selecting process the steps are common.Ho w do you write this in cucumber.I mean in feature and step defination files – Mangala Hegde Oct 16 '19 at 13:26
-
I'd bundle similar conditions together in the same scenario outline. – ou_ryperd Oct 17 '19 at 06:11
1 Answers
0
You can to use Cucumber tables e don´t need use excel files.
For read excel files, you will need to create an extensive excel reading class.
Why using Excel is an anti-pattern? click here
You can use scenario outline for example:
Feature: Calculator
As a user
I want to use a calculator to add numbers
So that I don't need to add myself
Scenario Outline: Add two numbers <num1> & <num2>
Given I have a calculator
When I add <num1> and <num2>
Then the result should be <total>
Examples:
| num1 | num2 | total |
| -2 | 3 | 1 |
| 10 | 15 | 25 |
| 99 | -99 | 0 |
| -1 | -10 | -11 |

Adriano Fukuda
- 68
- 5