Forum Discussion
- nmraoChampion Level 3Would you please show how you are using ${projectDir} with screenshot?
- jonathonContributor
Sure
I'm using it in two places:
within groovy in a suite setup script:
import groovy.time.* import groovy.sql.Sql log.info context.expand('${projectDir}') ...
Output is:
Tue Jun 15 09:57:16 ADT 2021: INFO: C:\
And also within a datasource step for a file
Output is:
java.io.FileNotFoundException: C:\allergy-drugs.csv (The system cannot find the file specified)
- nmraoChampion Level 3Thank you. Also show the screen shot of project location please.
- HimanshuTayalCommunity Hero
jonathon : Please try with the following code, hope it would resolve your issue
def projectPath = new com.eviware.soapui.support.GroovyUtils(context).projectPath //gets the path of the project root log.info projectPath
- jonathonContributor
- HimanshuTayalCommunity Hero
jonathon : I guess it is returning the correct location as it is under c:/, please try below code
testRunner.getTestCase().getTestSuite().getProject().getPath()
Related Content
- 12 years ago
Recent Discussions
- 18 days ago