Forum Discussion
Himanshu,
In my test case, i have Groovy script which i mentioned above followed by my rest request . In request, file name that need to be attached is a part of resource path like below.
/drservice/JPR/Ref/JW_20200910_000000.dat
where JW_20200910_000000.dat is my file name. There are many such files in my input folder which should be passed to groovy and then to resource path dynamically so that request can be submitted. I need help on getting the resource path and setting file there and submit request.
- HimanshuTayal4 years agoCommunity Hero
Apoorva6 :
You can split the path with "/" and save the last array into any variable and use further in you code where every you want to save.
Hope this will help. 🙂
- Apoorva64 years agoFrequent Contributor
Himanshu,
Thanks, But I am not able to get the resource path itself in first attempt. Any code snippet available ?
The one i am using in the groovy I shared, i am getting it as null. Any code snippet you have handy to get it ?
- HimanshuTayal4 years agoCommunity Hero
Apoorva6 :
Below code will give you project path where your project is stored :
//gets the path of the project root def projectPath = new com.eviware.soapui.support.GroovyUtils(context).projectPath log.info projectPath
Then you can move to any directory inside it accordingly.
Hope this will help you out 🙂