title: Xcode UI Test - how to tap() link in WKWebView?
body: <p>I'm trying to tap a link in a WKWebView using UI Test. The link is defined like so:</p>
  
  <pre><code>&lt;a data-toggle="tab" href="#haloLogin"&gt;
  &lt;img src=/Images/Halo_small.png"&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>I'm able to locate the link like this:</p>
  
  <pre><code>let haloLink = app.links.elementBoundByIndex(1) 
  </code></pre>
  
  <p>(There's another link at index 0)</p>
  
  <p>This is what I get when I print out haloLink.debugDescription:</p>
  
  <pre><code>haloLink: Attributes: Link 0x1257094e0: traits: 146029019138, {{143.0, -392.0}, {32.0, 32.0}}
  
  Element subtree:
  →Link 0x1257094e0: traits: 146029019138, {{143.0, -392.0}, {32.0, 32.0}}
  Image 0x125709cf0: traits: 146029019142, {{143.0, -392.0}, {32.0, 32.0}}
  </code></pre>
  
  <p>I've tried using </p>
  
  <pre><code>app.links["#haloLogin"] 
  </code></pre>
  
  <p>without success.</p>
  
  <p>My problem is that I'm not getting </p>
  
  <pre><code>haloLink.tap() 
  </code></pre>
  
  <p>to work.</p>
  
  <p>Any suggestions are welcome!</p>