title: How to use relative path during uploading of File
body: <p>I'm using Selenium WebDriver for auto tests. My current task is to upload a file.
  I use the following code to get the invisible element and <code>sendKeys</code> there</p>
  
  <pre><code>    WebElement elem = driver.findElement(By.id("profileImage"));
      String js = "arguments[0].style.height='auto'; arguments[0].style.visibility='visible'; arguments[0].style.display='block';";
      ((JavascriptExecutor) driver).executeScript(js, elem);
   elem.sendKeys("C:\\back.JPG");
  </code></pre>
  
  <p>I want to keep the file in the project folder. How can I use the relevant path to the file?</p>
  
  <p>Both of the following methods return the Eclipse folder:</p>
  
  <pre><code>    System.getProperty("user.dir"));
      new java.io.File("").getAbsolutePath());
  </code></pre>