title: How to click link text in selenium webdriver
body: <p>How to click the link text within an iframe?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;iframe id="PaymentFrame" src="http:///AccolentMVC/PaymentGW/payment?0JcINmGD1R3z/YV2fWT/YVRV8qXMPwXxer0Q634aBlT+KRL1LNdyEQtXL0MBOTXGTGdIM+NM/orGjrTKXS3tb5d5HG/6tUtND0JSdhGoAe1Ugk+kk81jR93x7u9aYYRdkluT3xDvNpoaKCaa0XMDmbJ1eFqMx7+7lw7PuFmXcXK5BO9NMUQspCPPIAPTmFJybBBHw4p2L+aHYTEA+FwZ0LTujo+wnhbQZL1qsoB9+xWSw/NOjHb/l+sfmmeMAcrO6SRl6/Rd2aY=" style="overflow:hidden;width:100%;height:475px" frameborder="0"&gt;&lt;/iframe&gt;
  &lt;html&gt;&lt;head&gt;
      &lt;meta name="viewport" content="width=device-width"&gt;
      &lt;title&gt;&lt;/title&gt;   
  &lt;aside&gt;
      &lt;fieldset id="navcontainer"&gt;
          &lt;legend&gt;&lt;div style="color:#A20F00;font-size:18px;font-weight:bold"&gt;Payment Methods&lt;/div&gt;&lt;/legend&gt;
          &lt;div align="center" style="margin:10px;font-size:16;font-weight:bold;"&gt;            
              &lt;p&gt;
          Select payment method:        &lt;/p&gt;
              &lt;ul&gt;         
  
              &lt;li style="list-style-type:circle;width:80px;margin:10px;font-size:16;"&gt;&lt;a href="/AccolentMVC/PaymentGW/UserData/1?key=Google%20Wallet&amp;amp;key1=Google%20Wallet"&gt;Google Wallet&lt;/a&gt;&lt;/li&gt;
              &lt;li style="list-style-type:circle;width:80px;margin:10px;font-size:16;"&gt;&lt;a href="/AccolentMVC/PaymentGW/UserData/1?key=gwAuthorizeNet&amp;amp;key1=AuthorizeNet"&gt;AuthorizeNet&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
          &lt;/div&gt;
      &lt;/fieldset&gt;
  &lt;/aside&gt;
      &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>We are using this code and it doesn't click the Link text:</p>
  
  <pre><code>    driver.switchTo().defaultContent(); 
      //driver.switchTo().frame(driver.findElement(By.id("PaymentFrame")));
      driver.findElement(By.linkText("Google Wallet")).click();   
  </code></pre>