html - uploading file - unable to find file field :input -
html - uploading file - unable to find file field :input -
i have html looking this:
<div id="promocodesupload"> <div class="qq-uploader"> <div class="qq-upload-drop-area" style="display: none;"> <span>drop </span> </div> <a class="qq-upload-button btn" style="position: relative; overflow: hidden; direction: ltr;">upload <input type="file" name="file" style="position: absolute; right: 0px; top: 0px; font-family: arial; font-size: 118px; margin: 0px; padding: 0px; cursor: pointer; opacity: 0;"> </a> <ul class="qq-upload-list"></ul> </div> </div>
and need upload file using capybara automated tests:
i have tried many ways unable find file field :input or element not found , on...
$code_id = '//*contains(@id,"promocodesupload")]/div/a[contains(., "upload")]' $code_path = 'c:\\promotion_codes.txt' within(:xpath, $code_id)do attach_file(:input, $code_path) end
i tried
capybara.ignore_hidden_elements = false , attach_file(:input, $code_path, :visible =false)
some otpions found here. still nothing.... easier node selectors not work @ //*[@id="promocodesupload"]/div/a/input
, on.... don't know do...
any help please?
i have seen qq-upload in past , specific javascript library uploading files doesn't work selenium-webdriver. may have integrating tool autoit script if happen on windows.
it's unfortunate drag , drop functionality seems problematic selenium-webdriver capable of doing. beingness able nail 'browse' button (if can succeed in doing that) causes problems since open dialog box outside scope of browser can do.
html file-upload capybara selector visible
Comments
Post a Comment