0

If I move a job in Jenkins (From Review), from the default directory to a Folder I have created, i get an error:

File or folder not found

I have some Selenium tests that use a file to read mock data. If I run the job from the default directory is everything ok, but if i move the job inside another folder, then i get the message that the file or folder not found.

I see that the name of the folder will be added to the path of the file. This is the reason why the file cannont be found.

Is there any configuration to resolve this issue.

Elio
  • 428
  • 3
  • 20
  • it sounds like in your selenium tests you are using Absolute paths , try to switch to relative paths or provide it from Jenkins side with Jenkins global or custom vars – BigGinDaHouse Jul 13 '18 at 11:44
  • the file is under "resources" and I get a reference to it with ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); URL resource = classLoader.getResource(testdatenFile);. The path is not absolute and there should be some other way than providing global or custom vars. – Elio Jul 13 '18 at 12:14

1 Answers1

0

I found the problem myself.

The name of the subfolder in Jenkins must not include spaces:

incorrect: "Sub Foler Name"

correct: "Sub-Folder-Name"

Elio
  • 428
  • 3
  • 20