element not interactable: element has zero size- Java Selenium

LBoyNewbie

I'm writing code to test the facebook website login feature. My chrome browser successfully launches and can enter user and password but I'm unable to select the 'Accept All' button when the test first goes on the website for the cookies.

My code goes onto Facebook.com then tries to find the accept all button. But I can get exception

element not interactable: element has zero size 
WebDriver driver = new ChromeDriver();
        driver.get("http://www.facebook.com");

        driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
        driver.findElement(By.xpath("//*[@id=\"facebook\"]/body")).click();

Below is the output of inspect

<button value="1" class="_42ft _4jy0 _9o-t _4jy3 _4jy1 selected _51sy" data-cookiebanner="accept_button" data-testid="cookie-policy-banner-accept" title="Accept All" type="submit" id="u_0_j_wR">Accept All</button>
Arundeep Chohan

//button[.='Accept All']

As well as adding a webdriver wait would solve your issue.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

element not interactable for the Gmail password field Selenium WebDriver using java

From Dev

python selenium - Element is not currently interactable and may not be manipulated

From Dev

element not interactable exception in selenium web automation

From Dev

OpenQA.Selenium.ElementNotInteractableException : element not interactable

From Dev

Selenium Element not interactable exception- How to overcome this?

From Dev

InvalidElementStateException on element that is visible and interactable

From Dev

org.openqa.selenium.ElementNotVisibleException: element not interactable while trying to click an element through selenium

From Dev

Finding shoe size element with selenium

From Dev

Selenium Java refresh element

From Dev

Locating an element on Selenium Java

From Dev

Element not interactable error clicking on Google Search button on Google homepage using Selenium Python

From Dev

ElementNotInteractableException: element not interactable error while trying to search for stock on www.finanzen.net using Selenium and Python

From Java

Find Xpath for element in Selenium Java

From Dev

Java and Selenium Stale Element Error

From Dev

Java selenium click element not working

From Dev

Java selenium find element with xpath

From Dev

Java selenium click element not working

From Dev

Selenium java to find the right element

From Dev

Java selenium find element with xpath

From Dev

Java ArrayList size with empty element []

From Dev

Selenium: java.awt.image.RasterFormatException: (y + height) is outside of Raster when using element size and location

From Dev

How to access the second element that has the same class name in selenium using java

From Dev

how to get Table element from a Div that has a Heading tag with a known text - using selenium and java

From Dev

Determining Whether a Matrix Has At Least One Zero Element

From Dev

Protractor - fields present but not visible - Element is not currently interactable and may not be manipulated

From Dev

How to find an Element by index in selenium webdriver for java

From Dev

Get page element by title attribute - Selenium and Java

From Dev

Selenium, Java - How to click at an element using text?

From Dev

Java - Selenium (chrome driver) element not visible exception

Related Related

  1. 1

    element not interactable for the Gmail password field Selenium WebDriver using java

  2. 2

    python selenium - Element is not currently interactable and may not be manipulated

  3. 3

    element not interactable exception in selenium web automation

  4. 4

    OpenQA.Selenium.ElementNotInteractableException : element not interactable

  5. 5

    Selenium Element not interactable exception- How to overcome this?

  6. 6

    InvalidElementStateException on element that is visible and interactable

  7. 7

    org.openqa.selenium.ElementNotVisibleException: element not interactable while trying to click an element through selenium

  8. 8

    Finding shoe size element with selenium

  9. 9

    Selenium Java refresh element

  10. 10

    Locating an element on Selenium Java

  11. 11

    Element not interactable error clicking on Google Search button on Google homepage using Selenium Python

  12. 12

    ElementNotInteractableException: element not interactable error while trying to search for stock on www.finanzen.net using Selenium and Python

  13. 13

    Find Xpath for element in Selenium Java

  14. 14

    Java and Selenium Stale Element Error

  15. 15

    Java selenium click element not working

  16. 16

    Java selenium find element with xpath

  17. 17

    Java selenium click element not working

  18. 18

    Selenium java to find the right element

  19. 19

    Java selenium find element with xpath

  20. 20

    Java ArrayList size with empty element []

  21. 21

    Selenium: java.awt.image.RasterFormatException: (y + height) is outside of Raster when using element size and location

  22. 22

    How to access the second element that has the same class name in selenium using java

  23. 23

    how to get Table element from a Div that has a Heading tag with a known text - using selenium and java

  24. 24

    Determining Whether a Matrix Has At Least One Zero Element

  25. 25

    Protractor - fields present but not visible - Element is not currently interactable and may not be manipulated

  26. 26

    How to find an Element by index in selenium webdriver for java

  27. 27

    Get page element by title attribute - Selenium and Java

  28. 28

    Selenium, Java - How to click at an element using text?

  29. 29

    Java - Selenium (chrome driver) element not visible exception

HotTag

Archive