title: How to find elements on div container using selenium webdriver
body: <p>I am testing a website which has div containers one is like lightbox dialogbox containing subscription detail and other is at footer which behave like frame and unscrollable also contains subscription details.</p>
  
  <p>How would I switch to these div tags and find elements on it.</p>
  
  <p>I have tried this</p>
  
  <pre><code>  driver.switchTo().frame(driver.findElement(By.className("sign-up-container")));
    List&lt;WebElement&gt; subButtons = driver.findElements(By.className("btn-black"));
   for(WebElement btn: subButtons){
          System.out.println(btn.getText());
      }
  </code></pre>
  
  <p>and similarly for other div conatiner and its gives me error "Element is not a frame element". That  error is right. 
  Also if I comment the first line then I received empty string.
  How can I find the elements on these div tags? Please let me know if you need more detail.
  HTML for subscription button on both div is same.</p>
  
  <pre><code> &lt;input type="submit" class="btn btn-black" value="Sign Up"&gt; 
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;input type="submit" class="btn btn-black" value="subscribe"&gt; 
  </code></pre>