Forum Discussion
nmrao
10 years agoChampion Level 3
You may add a property at test case level for the same(say FILE_NAME) and access its value in groovy script of the test case.
In case if it requires multiple files, define property(FILE_NAMES) value as comma separated(/path/to/file1,/path/to/file2) then split it using comma in the groovy script so that you get an arry and then loop thru it.
def fileName = testRunner.testCase.getPropertyValue('FILE_NAME')
In case if it requires multiple files, define property(FILE_NAMES) value as comma separated(/path/to/file1,/path/to/file2) then split it using comma in the groovy script so that you get an arry and then loop thru it.
def fileNames = testRunner.testCase.getPropertyValue('FILE_NAMES')
def fileNamesArray = fileNames.split(',')
fileNamesArray.each { fileName ->
//do the stuff
}
Related Content
- 7 years agothomasleesai