1

Meta -

OS: Windows 7
Selenium Version: 2.52.0, IDE, etc
Selenium Grid Extras 3.0.1
Browser: Chrome
Browser Version: 54.0.2840.99 (64-bit)

Expected Behavior -

Below code which clicks on "Browse File" and open windows popup to browse file and submit should work on Selenium & Selenium Grid

HTML Code

<div layout="row" layout-align="center center" class="layout-align-center-center layout-row"><input type="file" accept="text/csv,application/vnd.ms-excel,application/vnd.oasis.opendocument.spreadsheet,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" id="navigate-to-browse-file" class="input-box full-width ng-pristine ng-untouched ng-valid ng-empty" ngf-select="" ng-model="vm.uploadFiles" ngf-multiple="false" aria-invalid="false"><label class="md-primary md-raised md-button md-ink-ripple" md-ink-ripple="" for="navigate-to-browse-file"><span>Browse File</span><div class="md-ripple-container"></div></label></div>

Ruby Capybara RAutomation Code

And I click the tag "span" with text "Browse File" - Clicking the browse button works

Code for the selecting file in the window popup

file=$uploadfile_path
file = Dir::pwd + "#{file}"
file=file.gsub! "/", "\\"
window_handle = RAutomation::Window.new(:title => /#{window}/i)
window_handle.text_field(:class => field_input, :index => 0).set file

Actual Behavior -

Above code works with Selenium and doesn't work with SeleniumGrid

Error Msg

Unable to find file field "navigate-to-browse-file" (Capybara::ElementNotFound)

Steps to reproduce -

Click on browse file functionality in any application (cannot provide link to our application) ex: https://uploadfiles.io/ In windows popup enter the file path browse file window popup

enter image description here

enter image description here

testerBDD
  • 255
  • 3
  • 18
  • Did you try `Capybara.ignore_hidden_elements = false`? – Saša Zejnilović Dec 05 '16 at 20:53
  • Yes, I tried it and didn't not solve my problem – testerBDD Dec 07 '16 at 20:49
  • The file dialog utility is browser dependent. Selenium doesn't support exercising browser specific file dialog utilities. As browser specific file dialog utilities are considered 3rd party software you shouldn't be testing them either. The key is HTLM5 input type=file. Let me point you to [How to click on across browsers using Selenium Webdriver?](http://stackoverflow.com/questions/9726005/how-to-click-on-input-type-file-across-browsers-using-selenium-webdriver). – MikeJRamsey56 Dec 07 '16 at 21:16

0 Answers0