Problem in short : Accessing local file in SCRIPT Dispatcher with respect to project path i.e., def file = new File(groo
The main issue being : groovyUtils.projectPath is working only for first use case, and getting nothing for second use case.
After lot of trial & errors and search on the net, found a hint in one of the samples and the following approach working to be able to access the local file resource both below use cases as mentioned in the question.
soapUI itselfSo changed the code (script of mock dispatcher)
from:
def file = new File(groovyUtils.projectPath+"/${responseFileName}.xml")
to:
def projectPath = new File(mockOperation.mockService.project.path).parent
def file = new File(projectPath.+"/${responseFileName}.xml")
Note: file(resource) must be available in the same location where soapui project file is present on the disk i.e., after creatin
.warfile, update.warfile and make sure the required file is placed underWEB-INF/soapuias that where soapui's project xml is available.