java - org.openqa.selenium.ElementNotVisibleException -


I am trying to test a black box with Selenium with which I am working:

< Ul>
  • Mac OS: Version: 10.9.4
  • Java. Version: 1.6.0_65
  • Browser: Firefox Version 32.0.3
  • Selenium: Version 2.43.0
  • The page contains a table, each Line has a unique ID that is correctly extracted and stored in string item id , then I try to click on related WebElement and click on it:

      WebElement anchor = webDriver.findElement (By.id (itemId)); If (anchor! = Null) {anchor.click (); Sleeper.sleep (2); }  

    And I'm getting this exception:

      WARNING: Error extracting item data org.openqa.selenium.ElementNotVisibleException: element currently not visible Therefore, can not be interacted with  

    I've read some questions about the WebDriverWait and tried the following code:

      string item id = item.getAttribute ("id"); WebDriverWait Wait = New WebDriverWait (webDriver, 10); Web Element Anchor = wait.until (Expected conditions. By.id (itemId); anchor.click (); Sleeper.sleep (2); // Yes, I know that I had waited 10 seconds already , I have the time :)  

    And now I get the following exception:

      WARNING: Error removing item data Org.openqa.selenium.TimeoutException : Waiting for clickable element ended after 10 seconds  

    I have tried instead of element ElementIsVisible Click to abuse but it seems Note: This solution everywhere where it does not generate an error, but it is common in my experience. Problem on web application

    If you are working with invisible, cloned tables, then you can directly use the xpath in the view table or find it in the list and iterate over the list.

      list & lt; WebElement & gt; Temp_list = driver.find Elements (BID (Item ID)); Temp_list [1] .click (); // Example number, you have to get your element related to the notice  

    , that it will only work if you have more than one element from the same locator, you can check the size of the list can do.

      temp_list.size ();  

    Comments

    Popular posts from this blog

    c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

    android - how to get distance of 2 beacons and make a condtion base on that distance -

    c# - WPF Expander overlay used in ItemsControl -