title: Selenium Webdriver (Ruby) : Cannot click on button - element not found
body: <p>This is the page code:</p>
  
  <pre><code>&lt;div class="modal-buttons"&gt;
  
      &lt;button class="button-orange" ng-click="cancel()"&gt;
          &lt;span&gt;
  
              Cancel
  
          &lt;/span&gt;
          &lt;span class="icon cancel"&gt;&lt;/span&gt;
      &lt;/button&gt;
      &lt;button class="button-orange" ng-click="apply()"&gt;
          &lt;span&gt;
  
              Apply
  
          &lt;/span&gt;
          &lt;span class="icon run"&gt;&lt;/span&gt;
      &lt;/button&gt;
  </code></pre>
  
  <p>As you can see - this modal has two buttons and I have tried a dozen different ways - but I just want to click on the button labeled "apply"  No matter which route I take - it just keeps saying element not visible.</p>
  
  <p>Here are some of the things I've tried:</p>
  
  <pre><code>#   @driver.find_element(:class, "button-orange")[2].click
  #   @driver.find_element(:xpath, "//div[4]/div/div[2]/div[3]/button[2]").click
  # @driver. find_element(:link_text, 'Apply').click
  #   @driver. find_element(:tag, 'Apply').click
  # @driver.find_element(:css, "input[value='Apply']").click();
  #  @driver.find_element(:css, "input[value='Apply']").click();
  # @driver.find_element(:xpath, "//button[contains(text(),'Apply')]").click
  # @driver.find_element(:xpath, "//button[contains(text(),'apply')]").click
  # @driver.find_element(:xpath, "//input[@value='Apply']").click();
  #   @driver.find_element(:class, "button-orange.icon-run").click
  #  @driver.find_element(:css,'a[class$="button-orange"]').click
  #   @driver.find_element(:xpath, "").clear
  </code></pre>
  
  <p>The exact error I get is:  </p>
  
  <pre><code>Error: test_login_to_chute(LoginToChute)
    Selenium::WebDriver::Error::ElementNotVisibleError: element not visible
      (Session info: chrome=36.0.1985.125)
      (Driver info: chromedriver=2.10.267521,platform=Windows NT 6.3 x86_64)
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.42.0/lib/selenium/webdr
  iver/remote/response.rb:51:in `assert_ok'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.42.0/lib/selenium/webdr
  iver/remote/response.rb:15:in `initialize'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.42.0/lib/selenium/webdr
  iver/remote/http/common.rb:59:in `new'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.42.0/lib/selenium/webdr
  iver/remote/http/common.rb:59:in `create_response'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.42.0/lib/selenium/webdr
  iver/remote/http/default.rb:66:in `request'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.42.0/lib/selenium/webdr
  iver/remote/http/common.rb:40:in `call'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.42.0/lib/selenium/webdr
  iver/remote/bridge.rb:634:in `raw_execute'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.42.0/lib/selenium/webdr
  iver/remote/bridge.rb:612:in `execute'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.42.0/lib/selenium/webdr
  iver/remote/bridge.rb:369:in `clickElement'
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.42.0/lib/selenium/webdr
  iver/common/element.rb:54:in `click'
  C:/Analytics/AutomatedTesting/DevEnv/Wonderland/Full Regression/2.login_to_chute
  .rb:165:in `test_login_to_chute'
       162:       @driver.find_element(:xpath, "(//input[@type='text'])[8]").clear
  
       163:       @driver.find_element(:xpath, "(//input[@type='text'])[8]").send_
  keys "25"
       164:
    =&gt; 165: @driver.find_element(:xpath, "//div[4]/div/div[2]/div[3]/button[2]").c
  lick
  </code></pre>