title: Selenium Webdriver(JAVA) Nested Elements
body: <p>How do I access a nested element without using xpath</p>
  
  <p>this is how I would write it in Selenium WebDriver (Ruby)</p>
  
  <pre><code>@browser.find_element(:class, 'mapLock').find_element(:class =&gt; 'mapLockOverlay').click
  </code></pre>
  
  <p>But how would I write it in JAVA
  I have tried:</p>
  
  <pre><code>browser.findElement(By.className("mapLock").findElement(By.className("mapLockDisplay").click
  </code></pre>
  
  <p>which I know is obviously wrong</p>