Forum Discussion
sonya_m
Alumni
5 years agoThank you for your question. Let's see if anyone here can help.
HimanshuTayal ChrisAdams richie any thoughts here?
ChrisAdams
5 years agoSuper Contributor
Hi, this is definitely possible.
In a Groovy step, you can access all data source props in the current row. Look up ‘get data’ from the left-click mouse menu in the groovy step. You should be able to use the UI to navigate to the data source step and then the props within.
As for a conditional to run the test for a given row, yes, this can be done. I do this for all of my data-driven tests.
In my Excel sheet, the first col is always a Boolean headed ‘run test’.
The first step within my loop is a short groovy step to check the value of run test. If true, do nothing and let it run steps within loop. If false, jump to last step in loop.
I can’t provide specifics as I am away at the mo, but the others included will definitely be able to help further.
In a Groovy step, you can access all data source props in the current row. Look up ‘get data’ from the left-click mouse menu in the groovy step. You should be able to use the UI to navigate to the data source step and then the props within.
As for a conditional to run the test for a given row, yes, this can be done. I do this for all of my data-driven tests.
In my Excel sheet, the first col is always a Boolean headed ‘run test’.
The first step within my loop is a short groovy step to check the value of run test. If true, do nothing and let it run steps within loop. If false, jump to last step in loop.
I can’t provide specifics as I am away at the mo, but the others included will definitely be able to help further.