title: selenium click using span class or onclick
body: <p>I am a newbie to java and selenium webdriver. I am having an issue clicking an image. Below is the page source.</p>
  
  <pre><code>&lt;a href="javascript:void(0);"&gt;
  &lt;span class="HomeButton" onclick="javascript:onBtnHomeClick();"/&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>I tried below codes but did not work and still getting the Unable to locate element error.</p>
  
  <pre><code>driver.findElement(By.xpath("//a[@onclick='onBtnHomeClick()']")).click();
  
  wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(".//*[@id='js_AppContainer']/div[2]/div[1]/div[1]/span"))).click();
  
  
  wait.until(ExpectedConditions.visibilityOfElementLocated(By.className("HomeButton"))).click();
  </code></pre>
  
  <p>I have to click the homebutton. Any help would be much appreciated</p>