I am trying to run a scenario in jenkins that works locally, but it is complaining that it can't find the file. Where does jenkins create the file by default if I use the karate.write function?
Tried to read the file by using:
def opportunityID = read('file:target/OpportunityID.txt')
This works locally but when ran in jenkins it doesn't like it and complains about unable to find file.
// Code used to perform karate.write
- def txtFileName = 'OpportunityID.txt'
- def value = function writeOpportunityIDToFile(value,textFileName) { var time = java.lang.System.currentTimeMillis(); karate.write(value, textFileName); karate.log('saved opportunity id to:', textFileName); }
- call writeOpportunityIDToFile(opportunityID,txtFileName);
Error message when running in jenkins:
"opportunityApi_scenario002_run001_IT.feature:11 - could not find or read file: file:target/OpportunityID.txt"