title: Unable to click on a button/link on mobile view (iOS) via Appium using Capybara
body: <p>Unable to click on a button/link on mobile view (iOS) via Appium using Capybara</p>
  
  <p>My setup:</p>
  
  <p>I'm testing a website on the mobile view (iOS). On Desktop it works fine (using Capybara), but when I test on mobile view (iOS) via Appium using Capybara the test gets stuck on a button, that is visible but Capybara is unable to click it.</p>
  
  <p>The HTML:</p>
  
  <pre><code>&lt;div id="HeaderContent" class="accordion-content" style="display: block;"&gt;        
  
  &lt;div id="CompMessageContainer" class="content row hidden"&gt;
      &lt;div role="alert" aria-atomic="true" aria-relevant="all" aria-live="assertive"&gt;
          &lt;div class="uiMessaging alert-box radius success" id="ui-alert-message"&gt;
              &lt;div&gt;
                  &lt;div&gt;
                      &lt;div class="positiveCompMessageIcon"&gt;&lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div&gt;
                      &lt;div id="CartAlertMessage"&gt;
  
                      &lt;/div&gt;
                      &lt;ul id="cartAlertMessageDetails" class=" hidden"&gt;                            
                      &lt;/ul&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div id="milAndFirstRespContent"&gt;
      &lt;div id="cartBottomAlternateDiscountOptions"&gt;
          &lt;div id="compText"&gt;
              Random Text.
          &lt;/div&gt;
          &lt;div class="desktopComp-btn-container"&gt;
              &lt;a id="imgMil" href="#" class="login-trigger left utrack" data-scope="mil" data-track-event="CompTrigger"&gt;
                  &lt;div class="desktopCompMilBtn"&gt;&lt;/div&gt;
              &lt;/a&gt;
              &lt;a id="imgResp" href="#" class="login-trigger left utrack" data-scope="responder" data-track-event="CompTrigger"&gt;
                  &lt;div class="desktopCompRespBtn"&gt;&lt;/div&gt;
              &lt;/a&gt;
              &lt;div class="desktopCompLogo"&gt;&lt;/div&gt;
              &lt;div id="desktopCompVerified" class="hidden"&gt;
                  &lt;div class="desktopCompVerified"&gt;&lt;/div&gt;
                  &lt;div id="desktopCompStatus"&gt;&amp;nbsp;Status Verified&lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div&gt;
  
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>My attempts to click the <code>&lt;div class="desktopCompMilBtn"&gt;&lt;/div&gt;</code> button or <code>a id="imgResp"</code> element.</p>
  
  <pre><code>pry(#&lt;Object&gt;)&gt; find("div.desktopCompMilBtn").visible?
  =&gt; true
  
  pry(#&lt;Object&gt;)&gt; find("div.desktopComp-btn-container").visible?
  =&gt; true
  
  pry(#&lt;Object&gt;)&gt; find("div.desktopComp-btn-container").find("div.desktopCompMilBtn").visible?
  =&gt; true
  
  pry(#&lt;Object&gt;)&gt; find("div.desktopComp-btn-container").find("div.desktopCompMilBtn").click
  =&gt; nil
  
  pry(#&lt;Object&gt;)&gt; find("div.desktopComp-btn-container").find("a#imgMil").visible?
  =&gt; true
  
  pry(#&lt;Object&gt;)&gt; find("div.desktopComp-btn-container").find("a#imgMil").click
  =&gt; nil
  
  pry(#&lt;Object&gt;)&gt; find("div.desktopComp-btn-container").find("a#imgMil").find("div.desktopCompMilBtn").click
  =&gt; nil
  </code></pre>
  
  <p>Unfortunately nothing has worked thus far in being able to click the button. By the way the button is supposed to open up a new window, not sure if that matters or not.</p>