I have been trying to get the text from various div and tables for some BDD's I am writing in Cucumber. Everytime I try to acquire anything from the frontend of the website I'm working on it just pulls nothing. I need to know what I specifically need to do to get this content.
The page element I'm trying to retrieve from is similar to this
<div id="statMsg" class="statusMsg">Your changes are saved.</div>
These are the 2 methods that are currently trying to retrieve the text from the div.
public WebElement savedText() {
return webdriver.findElement(By.className("statusMsg"));
public void UserClicksOnSave() throws InterruptedException {
daSave.saveOn().click();
daPage.savedText().getText();