title: Protractor - How to upload file using ng-file-upload in test case without changing code?
body: <blockquote>
    <p>I am using <a href="https://github.com/danialfarid/ng-file-upload" rel="nofollow noreferrer">https://github.com/danialfarid/ng-file-upload</a> for file upload. I have to test it so I wrote protractor test case but it not working. </p>
  </blockquote>
  
  <p>Code</p>
  
  <pre><code>&lt;div class="col-lg-12 up-buttons"&gt;
       &lt;div ng-file-select="" ng-model="files" ng-model-rejected="rejFiles" class="btn btn-default" ng-multiple="false" ng-accept="'text/csv,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'"  ng-model-rejected="rejFiles" tabindex="0"&gt;Choose file&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Test case</p>
  
  <pre><code>it('upload file', function(){   
    var fileToUpload = 'C:/Users/Anusha/Desktop/demo.csv';
    var absolutePath = path.resolve(fileToUpload);
    $('input[type="file"]').sendKeys(absolutePath);
    browser.sleep(1500);
  })
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/YKyv2.png" alt="testcase result"></p>
  
  <p>I can upload file but it is received in <strong>rejFiles</strong> model instead of <strong>files</strong> model eventhough file format is correct one. Could anyone please suggest me how to do this?</p>