node.js webdriverio / webdriver.io Upload file
<p>How to upload a file in wdio?</p>

<p>The element that allows you to select a file to upload (the normal way) is just an 'Upload File' clickable link.</p>

<p><a href="https://i.stack.imgur.com/xL3CP.png" rel="nofollow"><img src="https://i.stack.imgur.com/xL3CP.png" alt="enter image description here"></a></p>

<p>Source:</p>

<pre><code>&lt;a href="javascript:void(0)" id="fileupload1" name="DocumentCreatedFileId" 
ng-hide="Model.Uploading" pl-upload="" pl-progress-model="Model.Percent" 
pl-auto-upload="true" ng-disabled="disabled" pl-files-model="Model.Files" 
pl-filters-model="filter" on-file-added="Uploading(true)" 
on-file-uploaded="Uploading(false)" class="ng-binding ng-isolate-scope" 
pl-max-file-size="20mb" pl-url="/api/storage/upload" 
pl-flash-swf-url="/content/moxie.swf" 
pl-silverlight-xap-url="/content/moxie.xap"&gt;Upload File&lt;/a&gt;
</code></pre>

<p>I've tried <code>browser.chooseFile(documentsAddPage.uploadFile, 'X.png');</code>, but I get the webdriver.io's favourite error - <code>selector needs to be typeof 'string'</code></p>

<p>The <code>documentsAddPage.uploadFile</code> is <code>{  get: function () { return browser.element('#fileupload1'); } },</code></p>