I have a big example table in scenario outline with around 20 columns
Scenario Outline: ....
Given ....
When ...
Then ....
Examples:
|col1|col2|col3|col4|col5|........|col20|
|val1|val2|val3|val4|val5|........|val20|
Is it possible split examples table into smaller chunks like this
Examples:
|col1|col2|col3|col4|col5|
|val1|val2|val3|val4|val5|
|col6|col7|col8|col9|col10|
|val6|val7|val8|val9|val10|
....upto 20
Each row of the examples table denotes one scenario run. If you break up the row then certain values in each scenariooutline run will not have values and also you will have more runs then actual required. So the answer is no.
What you can try to do is store the all the data or some outside the feature file, in an excel file or even a database. The excel or db will have a unique key column which will need to match the row index in the examples table.
Feature file -
Given Data is stored in file located at //project/module/data/bigscenario.xlsx and use index <DataRowIndex>
Given
When
Then
Examples:
| DataRowIndex |
| 1 |
| 2 |
| 3 |
| 5 | //Even skip index so 4 will not run
StepDefinition code -
private static boolean dataFlag = false;
private static Map<Integer, DataObject> data = new HashMap<>();
private int rowindex;
@Given("^Data is stored in file located at (.*?) and use index (.*?)")
public void getData(String path, int rowindex) {
if(!dataFlag) {
//Access data from excel using apache poi or db code, and store in map as dataobjects.
dataFlag = true; //Data access runs only for first scenario run.
}
this.rowindex = rowindex; //Key to get data for scenario from map
}
This has its pros and cons. You are separating data from feature file. Introducing technical details in scenarios. Loosing capabilities of data matching and transformation in steps. Major pro data is manageable.