Page contains this form
:
<form target="PID297_TGT_FRAME" action="/app/upload/57aa897a64d9" class="form form-default" method="post" enctype="multipart/form-data">
<div>
<input type="hidden">
<input name="PID297_file" class="file-upload" type="file">
<div aria-pressed="false" role="button" class="v-button" tabindex="0">
<span class="v-button-wrap">
<span class="v-button-caption">Import</span>
</span>
</div>
</div>
</form>
Now I want to upload file to form. After searching stackoverflow I found that it is possible to send file path to input
with type file
. So I did this:
var elem = Driver.FindElement(By.Name("PID297_file")).SendKeys(filePath);
Unfortunelly I am getting Exception
with Message:
Element is not currently visible and so may not be interacted with
Is there something wrong with my code?