Forum Discussion
sonya_m
SmartBear Alumni (Retired)
Thank you for your question. Let's see if anyone here can help.
HimanshuTayal ChrisAdams richie any thoughts here?
ChrisAdams
4 years agoChampion Level 3
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.
Look up the groovy syntax for ‘go to test step’
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.
Look up the groovy syntax for ‘go to test step’
I can’t provide specifics as I am away at the mo, but the others included will definitely be able to help further.
Related Content
Recent Discussions
- 59 minutes ago
- 2 hours ago
- 2 hours ago
- 2 hours ago