0

So there is some text in text field and the HTML doesn't show the text Text field with HTML

Is it possible for selenium to pick the text "test" if the text is coming from an api

1 Answers1

0
public class CustomExpectedConditions {
    public static ExpectedCondition pageStateToBeReady() {
        return object -> (((JavascriptExecutor) getDriver()).executeScript("return document.readyState")).equals("complete");
    }
}

public static void pageToBeLoaded() {
        try {
            new WebDriverWait(getDriver(), TIMEOUT).until(CustomExpectedConditions.pageStateToBeReady());
        } catch (TimeoutException e) {
            log.info(e.getMessage(), e.getCause());
            throw new TimeOutError("Page is not loaded");
        }
    }

Use this code snippet. It will wait for page load. After it, data from API will be available.

Karen
  • 105
  • 1
  • 1
  • 5