Facing issue to read content after clicking an element in Selenium. I have tried with below code:
if(webElement2.isDisplayed()) {
webElement.explicitWaitToClickElement(4,webElement);
webElement2.click();
}
String tagContent = (String) ((JavascriptExecutor)
BrowserUtilities.getDriver()).executeScript(“return arguments[0].innerText;”, webElement2);
Source: Read More