Issue
I am facing file not found exception while trying to run my test from jenkins , on my local its working as expected, however when m running it from jenkins it should search the file in jenkins workspace instead of my local path C:\Users\user.name\eclipse-workspace\projectFolder\src\test\java\resources\global.properties
can any one help me with this issue.
Solution
Even though I don't know what your project structure looks like. All Jenkins jobs have their own workspace path. I guess you check out your project into the workspace by job configuration.
To search a file from the workspace path you can just use the global WORKSPACE
variable like env.WORKSPACE/my/test/resource/path/
.
https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables
Answered By - MaGro
Answer Checked By - Senaida (JavaFixing Volunteer)