title: Webdriver I/O - Get Links
body: <p>I am attempting to test a web site using Webdriver I/O. </p>
  
  <pre><code>var jasmine = require('jasmine');
  var webdriverio = require('webdriverio');
  
  var client = null;
  var settings = {
      testAbilities: { desiredCapabilities: { browserName: 'phantomjs' } },
  };
  
  describe("Test", function() {
    it('Should load Successfully', function(done) {
    client = webdriverio.remote(settings.testAbilities).init()
    .url('http://www.example.com')
    .selectorExecute('//a', function(links) {
      return links;
    }).then(function(links) {
      for (var i=0; i&lt;links.length; i++) {
        alert(JSON.stringify(links[i]));
      }
  
      done();
    });
  });
  </code></pre>
  
  <p>When this test runs, I see the following printed in the <code>alert</code> window:</p>
  
  <pre><code>{"ELEMENT":"0"}
  </code></pre>
  
  <p>I was expecting a link. How do I get an anchor tag? I would like to get its position so that I can "click" it via my automated test.</p>
  
  <p>Thank you!</p>