While uploading a file, i'm getting this error: "Element is not reachable by keyboard" Can you help me fix it? The only thing I want to do is to attach a PDF file. But as the cusror hovers, i'm unable to find the click or upload file.
Code is:-
WebElement uploadElement = driver.findElement(By.xpath("//*[@id=\"registerproduct\"]/div/div[4]/div/div/div/div[2]/div[2]/div/div/span/label"));
uploadElement.sendKeys("C:\\Users\\Bharat\\Downloads\\apmr-auction-detail-574.pdf");
The Html is:-
<div class="col s12">
<div class="file-field input-field">
<div class="">
<input id="btn_myFileInput" onchange="checkimagetype()" name="productsheet" style="display:none;" type="file">
<span class="attached sp_head">
<label for="btn_myFileInput" class="gray-lite attach_circle left">
<i class="fa fa-paperclip small"></i>
</label>
<span class="sp_head">
Attach specification sheet</span>
<span id="fileinput-msg"></span> </span>
</div>
</div>
Does anyone know a remedy for this?