0

I have a Jenkins Job which Runs my Selenium Web Automation Project using Selenium Grid Docker. The docker is running on a Testing server. I am able to run that job successfully until I have to pass a File (an image file) which I have to upload on the Web Page.

Now when I run the code locally then it works fine as the image file is in my local computer folder and is accessible through the path which I have passed.

But in case of Jenkins that local file location is not accessible and I get File Not Found exception.

So my question is How to Pass the local file path so that it can be accessible from Jenkins as well.

In the background, Jenkins server is connected to GIT/Stash from where it picks the Automation code.

2 Answers2

0

Use a File parameter. When you start the job, you give it a local file location (it can have a default value). The file will be uploaded to the workspace and is then available to use in your jenkins job.

Rob Hales
  • 5,123
  • 1
  • 21
  • 33
0

I got it with the help Relative Path. I am saving the image file in my Resource Folder and then passing the relative path of the file where required.