2

I have written some phpunit selenium code to upload a file. I find it working perfectly fine in my local and the i have given the path of the file as

  $filePath = getcwd(). "/Images/test_Image1.png"

When I run the same piece of code in jenkins (running on saucelabs), the test fails saying the path is not absolute

 unknown error: path is not absolute: /var/lib/jenkins/workspace/UploadProject/test_Image1.png (Session info: chrome=47.0.2526.73) (Driver info: chromedriver=2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067),platform=Windows NT 6.1 SP1 x86_64)

but I can see that the image file exists on that path. So how should i give the absolute path here

Mukesh Takhtani
  • 852
  • 5
  • 15
user3920295
  • 889
  • 2
  • 13
  • 31

1 Answers1

-1

So how should i give the absolute path here

See: Transfrom relative path into absolute URL using PHP

If you use not PHP, you can use sample from link like code example and create your function.

Community
  • 1
  • 1
Vika Marquez
  • 353
  • 1
  • 3
  • 12