Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
2.2k views
in Test Automation by
I have a small piece of code:
 
 
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
 
WebElement menuOption = driver.findElement(By.className("icon-user"));
  
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); 
 
menuOption.click();
 
It does not go beyond the last line   i.e menuOption.click();
 
I get Exception:
 
Exception in thread "main" org.openqa.selenium.ElementNotVisibleException: element not visible
website staging.revampon.net

1 Answer

0 like 0 dislike
by
Number 1.

make sure that "icon-user" is unique. i mean there is only one element in whole page with class name as "icon-user". If so you will have to wait for element to be visible. Also try using explicit wait / fluent wait. If  your element is not unique, you need to try another approach to identify element.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...