Below is my HTML code:
<div id="file-upload-div" class="widget-vsize"> <div id="file-upload-wrapper"> <div id="file-upload-controls" class="btn-group-sm"> <input id="file" type="file" multiple="" style="display: inline;"> <span class="checkbox" style="display: inline-block; padding-top: 6px;"> <button id="upload-submit" class="btn btn-default-ext" style="float: right;width: 33px;" type="submit"> <div class="progress" style="display:none"></div> <div id="file-upload-results-row"><div> and I need to upload gist file from my local system using CasperJS and below is my CasperJS code for file uploading
casper.then(function(){ casper.evaluate(function () { var element = document.getElementById('file'); this.sendKeys(element, '/home/prateek/Download/Notebook 43.R'); this.wait(3000) }); this.click({ type : 'css' , path : '#upload-submit'}); this.echo('file has been uploaded') }); but still the above CasperJS code is not working. I mean the file is not getting uploaded.