title: Ruby - SeleniumGrid - how to handle windows popup (File-> browse) in selenium grid
body: <p>Meta -</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>Expected Behavior -</p>
  
  <p>Below code which clicks on "Browse File" and open windows popup to browse file and submit should work on Selenium &amp; Selenium Grid</p>
  
  <p>HTML Code</p>
  
  <pre><code>&lt;div layout="row" layout-align="center center" class="layout-align-center-center layout-row"&gt;&lt;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"&gt;&lt;label class="md-primary md-raised md-button md-ink-ripple" md-ink-ripple="" for="navigate-to-browse-file"&gt;&lt;span&gt;Browse File&lt;/span&gt;&lt;div class="md-ripple-container"&gt;&lt;/div&gt;&lt;/label&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Ruby Capybara RAutomation Code</p>
  
  <p>And I click the tag "span" with text "Browse File" - Clicking the browse button works</p>
  
  <p>Code for the selecting file in the window popup</p>
  
  <pre><code>file=$uploadfile_path
  file = Dir::pwd + "#{file}"
  file=file.gsub! "/", "\\"
  window_handle = RAutomation::Window.new(:title =&gt; /#{window}/i)
  window_handle.text_field(:class =&gt; field_input, :index =&gt; 0).set file
  </code></pre>
  
  <p>Actual Behavior -</p>
  
  <p>Above code works with Selenium and doesn't work with SeleniumGrid</p>
  
  <p>Error Msg</p>
  
  <pre><code>Unable to find file field "navigate-to-browse-file" (Capybara::ElementNotFound)
  </code></pre>
  
  <p>Steps to reproduce -</p>
  
  <p>Click on browse file functionality in any application (cannot provide link to our application) ex: <a href="https://uploadfiles.io/" rel="nofollow noreferrer">https://uploadfiles.io/</a>
  In windows popup enter the file path
  browse file
  window popup</p>
  
  <p><a href="https://i.stack.imgur.com/r2Fph.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r2Fph.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/D9wxf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/D9wxf.png" alt="enter image description here"></a></p>