Hey AAB
I've had a quick look and I'm probably not the best person to fix this unless I re-create your whole project and scripts and work through it that way - but I have a couple of comments that might help.
1. I'd say quite often people have problems because ReadyAPI! is looking for backslashes (e.g. '\') in the path rather than forward slashes (e.g. '/') when using both absolute and relative paths.
If you look at the Datasource teststep item if you select any of the datasource types that source a file (e.g. directory, file, excel) - it dynamically generates a path with backslashes.
The error response dialogue in your 2nd image file actually displays the path with backslashes
If you look at a project's 'Project Properties', you will notice the 'File' attribute (which is the full path to the project file uses backslashes).
Despite the above - I am aware that groovy scripting appears to support only forward slashes (e.g. '/') - or I just had a quick check and a path wasn't recognised as path with backslashes (e.g. '\')
You've specified your projectDir property as one of your Project's custom properties. The Project Property tab includes a Resource Root attribute (see link) that typically (if specified) has 2 options - the {projectDir} property and the {workspaceDir} property. Are you trying to recreate something that's already embedded within ReadyAPI!'s native functionality? That's a question - I don't know the answer - I've never used this property before.
Ok - just done a bit more reading - I found here
If the project directory is D:\projects\webservice\ (where the project file is resides).
The absolute path to the file is D:\data\testdata.xls.
To use the file path relative to the project directory, use ${projectDir}\data
. For example:
D:\projects\webservice\data\testdata.xls
To use the file path relative to the directory that contains the workspace file, use ${workspaceDir}\data
. For example:
D:\projects\data\testdata.xls
So follow the above to make sure you have everything located in the correct directories.
The path you specify as the projectDir property uses forward slashes (e.g. C:/Users/CDRBK89/Documents/Bosa/Put Data at the Center/Automation/WORKSPACE-PDC/Concepts) - I'm always dubious about including paths that 1. are too long (which is quite likely if you're using a path within your windows user's profile) and 2. includes spaces or any special characters. I've had problems getting a groovyscript to run that appeared perfect, but simply didn't work until there were zero spaces, special chars and I reduced the length. Other times I have had paths that included these two points and there wasn't a problem. It was always too much hassle cos I never knew if it was going to work - so I just take it as a rule now - short paths/no spaces or special chars.
Finally - you provided a screenshot of some of your groovy when you get the error dialogue - I'd drop in a couple of logging commands in there to just verify what variables you are specifying is correct.
you've got 'def path = context.expand ( '${#project#projectDir}')' in your script and you say it isn't working? try capitalising the #Project# scope so rather than '${#project#projectDir}' instead it's '${#Project#projectDir}'
you need the above working so it resolves otherwise it's not going to work - after that I'd also add some logging in where you declare the resultPrimary and resultTarget variables. It seems to be at this point where it's not finding the path correctly
As I said I'm not the best placed person to fix this without reproducing your whole project - but the above is the sort of thing I'd go through to try and identify and resolve the problem.
Hope this helps........Unsure it will! :)
rich