Hi All,

I am trying to write a UI test case in selenium which requires to send the
keys to invisible file element in UI. In a normal scenario, user selects
the file using a file browser and when the user selects a file, the
selected file will be automatically passed to that file UI element.
Following is the code fragment that is used for this purpose. In this I
need to send keys to element with id "selected-file".

<div class="input-group input-wrap file-upload-control">
    <input type="text" class="form-control" readonly="">
    <input type="file" class="form-control" accept=".zip" id =
"selected-file" name="selected-file">
    <div class="input-group-btn">
        <button class="btn browse" type="button" title="Browse File">
            <i class="fw fw-file-browse" aria-hidden="true"></i>
            <span class="hidden-xs"><%= i18n.localize("browse")%></span>
        </button>
    </div>
    <div class="input-group-btn">
        <button class="btn btn-default btn-primary asset-upload"
type="button" title="Upload">
            <i class="fw fw-upload" aria-hidden="true"></i>
            <span class="hidden-xs"><%= i18n.localize("upload")%></span>
        </button>
    </div>
</div>

 Selenium finds this element but it does not allow to send the keys by
throwing and exception "Element is not currently visible and so may
not be interacted with". How can I write a test case for this
scenario?

Any helps on this is highly appreciated.

Thanks.

Regards,

Megala

Megala Uthayakumar

Software Engineer
Mobile : 0779967122
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to