问题
Related issue: How can to upload the pdf file using Karate UI Automation?
Could you please help me to create karate ui code for uploading video file in this structure:
#shadow-Root(Open)
<div name="upload" class="upload vertical layout flex iron-selected" tabindex="0">
<div class="suggester">
<nuxeo-path-suggestion id="pathSuggesterUpload" always-float-label=""></nuxeo-path-suggestion>
<span class="horizontal layout "></span>
</div>
<div id="dropzone" class="vertical layout flex">
<input hidden="" id="uploadFiles" type="file" multiple="">
<div class="vertical layout center center-justified flex">
<div class="dropzone-label horizontal layout center center-justified">
<a href="javascript:undefined">
Drag and drop, or click to select files to upload.</a>
</div>
<span>or link files from</span>
<div class="importActions horizontal layout wrap">
I tried below code to upload, but after clicking on upload button link file upload window is not appearing :
*script('document.querySelector("#importPopup").shadowRoot.querySelector("#bulkCreation").shadowRoot.querySelector("#dropzone > div > div.dropzone-label.horizontal.layout.center.center-justified > a").click()')
* def pathOffile = '/Users/shilpisharma/Documents/batman.mp4'
* driver.inputfile('//*[@id="dropzone"]/div/div[1]/a', pathOfFile)
chrome version is: Version 81.0.4044.138 (Official Build) (64-bit)
回答1:
This is not yet released, here is the documentation for Chrome: https://github.com/intuit/karate/tree/develop/karate-core#driverinputfile
You can use the developer guide to build and test: https://github.com/intuit/karate/wiki/Developer-Guide
Or you have to wait for the next version.
来源:https://stackoverflow.com/questions/61898300/how-to-upload-the-video-file-in-karate-ui-automation