I am getting an error " Element is not reachable by keyboard" Can you guys please help me in it. I just want to attach the PDF file but as the cusror goes on it i am unable to find click on it nor upload file on it.
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\\Rahul\\Downloads\\kemgo-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>
Can you guys help me in uploading file. Thanks