Unanswered question

Relative path of Project File

Can we get the relative path of Project file for Neoload project?

We are using GWT and everytime we get a new build, we have to change the GWT RPC files in the lib\plugins\gwt of our NeoLoad project. We have written a script that downloads the latest application war file from our servers and then using Command Line action from Neoload makes a call to a batch file that extracts the war file and copies the necessary jar files and gwt.rpc files to lib\plugins\gwt folder. Since we work in collaborative environment, we share scripts with different developers and we do not want to hardcore the path either to place where we save the application war file after extracting or using absolute path while extracting gwt.rpc files or copying it to lib\plugins\gwt folder. So we want to use relative paths so that same project can run on different machines without the necessity of maintaining same folder path for projects.

What is the solution for this problem? One thought is, if somehow, we can get relative path of our current project somehow, we can then use that path to extract GWT RPC files. Can someone please tell me how to do this?

Abhiram P.
Abhiram P.

Abhiram P.

Level
1
125 / 750
points

Answers

Hi, two things, you could use the ${NL-CustomResources} variable inside some javascript to get the path inside the project and then work out the relative path from there however, the second thing is that all RPC files would have already been read in when Neoload started and would be in use so trying to replace them with newer files is likely to fail?

Abhiram P.
Abhiram P.

Abhiram P.

Level
1
125 / 750
points

Thanks for your response Neil. Yes I already tried that option and it does not work. What happens is if you use ${NL-CustomResources} variable, it gives you the relative path in AppData\Roaming\V6.5\custom-resources folder and not the relative folder path of your project. So when we use ${NL-CustomResources} variable, it directly extracted our RPC files in the custom-resources folder inside AppData\Roaming\V6.5. However, every-time you start a test or even run the script in the Check Script mode, Neoload copies all the files from your local project folder directory into AppData\Roaming\V6.5\.. sub directories. So if our local project folder lib directory is empty, all the files we extracted using ${NL-CustomResources} are erased which is undesirable.

That is why I am looking for another option.

Fousseyni B.
Fousseyni B.

Fousseyni B.

Level
2
1014 / 2000
points

Hello Abriham,

How about writing a java or bash script and use it as a neoload action to put the build in an appropriate place ?
So, before testing something you just have to run this action test as a validation to set up everything

Best Regards,
Fousseyni B.

Abhiram P.
Abhiram P.

Abhiram P.

Level
1
125 / 750
points

Thank you Fousseyni B for your response.

I am on windows so I I am currently using a .bat file to create test setup. If you print the current working directory from the NeoLoad command line action, for me it prints C:\Program Files\NeoLoad 6.5. So again it does not give us the relative path of the Neoload Project we are working on. I have not tried Java Script. But I am assuming it will give us similar result. I will try that and see what happens. But for now, I think I will have to use absolute path in my scripts. If Java script works, I will let you know.

Keith V.
Keith V.

Keith V.

Level
0
10 / 100
points

${NL-CustomResources} must have been fixed, it's working for me (points to the relative path in my project's folder).