Skip to content
Advertisement

Is there any get body tag method for WebElement class in Selenium Java?

I’ve been trying to get body of pages within HTML source. I’ve been trying it with WebElement Class. I can’t access invisibilityOfAllElements method or let me say it throws error. I’ve written code like that:

WebElement element = waitBody.until(ExpectedConditions.invisibilityOfAllElements(By.tagName("body")));

waitbody is object of WebDriverWait Class that I’ve defined. Eclipse highlights underline of invisibilityOfAllElements. Is there any idea to solve this? Thank you.

Advertisement

Answer

invisibilityOfAllElements() expects a locator of type ‘List of WebElement’ but you are providing a ‘by’.

Use invisibilityOfElementLocated instead.

6 People found this is helpful
Advertisement