code: public void uploadFile(String filePath) {
          SeLionLogger.getLogger().entering(filePath);
          Preconditions.checkArgument(StringUtils.isNotBlank(filePath), "Please provide a valid file path to work with.");
          String filePathToUse = new File(filePath).getAbsolutePath();
          LocalFileDetector detector = new LocalFileDetector();
          RemoteWebElement element = getElement();
          element.setFileDetector(detector);
          element.sendKeys(filePathToUse);
          SeLionLogger.getLogger().exiting();
      }
docs: A Utility method that helps with uploading a File to a Web Application.
  
  @param filePath
  - A String that represents the file name to be uploaded along with its path.
  <pre>
  TextField txtBox = new TextField(&quot;upfile&quot;);
  // Here the html snippet for the above text box would be
  // {@literal &lt;}input type=file name=upfile{@literal &gt;}
  // Make sure you are providing the locator of the &quot;file&quot; type textbox
  // else uploadFile() method will fail.
  txtBox.uploadFile(&quot;src/test/resources/upload.txt&quot;);
  Button submitButton = new Button(&quot;//input[@value='Press']&quot;);
  submitButton.click();
  </pre>