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.
How would I switch to these div tags and find elements on it.
I have tried this
driver.switchTo().frame(driver.findElement(By.className("sign-up-container")));
List<WebElement> subButtons = driver.findElements(By.className("btn-black"));
for(WebElement btn: subButtons){
System.out.println(btn.getText());
}
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.
<input type="submit" class="btn btn-black" value="Sign Up">
and
<input type="submit" class="btn btn-black" value="subscribe">