I am struggeling with selenium.
Basically I want to click the following element to toggle the element:
<div class="view-icon fadeIn" title="" data-placement="top" data-toggle="tooltip" data-original-title="Switch to List View">
<i class="fa fa-bars"></i>
</div>
It changes to:
<div class="view-icon fadeIn" title="" data-placement="top" data-toggle="tooltip" data-original-title="Switch to Tab View">
<i class="fa fa-list-alt"></i>
</div>
After that I just want to fill in the form and test its output.
The method I wrote for clicking this element:
public void clickAtListView() {
WebElement listView = driver.findElement(By.xpath("//div[@class='view-icon fadeIn']"));
listView.click();
}
However, i am getting:
Exception in thread "main" org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with
Command duration or timeout: 50 milliseconds
Any recommendations why I get this exception?
I appreciate your answer!
UPDATE
It seems to me that the list element gets shown when I put Thread.sleep(10000); before:
However, i still get the exception ;(