Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98336

handling submenu item with webdriver selenium

$
0
0

I want to click submenu item using selenium webdriver which is invisible bydefault. It becomes visible on mousehover . I tried with some code and it is giving error as shown below

Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException: Element is not currently visible and so may not be interacted with.

Here the code:

    Actions actions = new Actions(driver); 
    WebElement menuHoverLink = driver.findElement(By.linkText("RENT")); 
    //WebElement menuHoverLink = driver.findElement(By.className("current")); 
    actions.moveToElement(menuHoverLink); 
    WebElement subLink = driver.findElement(By.cssSelector("a[href='nemc.com/rentals/easy-rent']")); 
    actions.moveToElement(subLink); 
    actions.click(); 
    actions.perform();    

Viewing all articles
Browse latest Browse all 98336

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>