title: How to upload a file from project folder regardless of the OS(Windows or Unix) When the tests are executed on Selenium Grid
body: <p>I wrote a test(Selenium WebDriver with java) in which I have to upload a file from the OS file explorer(upload window). </p>
  
  <p>I used,</p>
  
  <pre><code>String path =System.getProperty("user.dir")+ File.separator +"TestDoc"+File.separator+"File.pdf"; 
  </code></pre>
  
  <p>It works on my local(Windows Machine), but gives an error when I try run on a AWS server using Jenkins. </p>
  
  <pre><code>error: NullPointerException.
  </code></pre>
  
  <p>After debug what i saw was its taking my local machine folder address
  <code>(C:\Users\...\...\TestDoc\File.pdf)</code></p>
  
  <p>Is there any other way that could upload the file from project folder, with the folder address of that particular machine, regardless ?</p>