-1

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)

desertnaut
  • 57,590
  • 26
  • 140
  • 166
ShSharma
  • 9
  • 3

1 Answers1

0

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.

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248
  • But after clicking on link to upload file, File upload pop is not appearing. I tried on both chrome as well as safari but still not able to see the pop up window to upload file.With same locator of script if i execute in chrome console then its working.Ok, Thanks For Your Response. – ShSharma May 20 '20 at 03:13
  • When this is going to be released. Is there any ETA for this. – ShSharma May 20 '20 at 03:19
  • @ShSharma nothing can be said for certain. check back after a week – Peter Thomas May 20 '20 at 04:37