Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've come across with the similar problem recently. Please note, I work with Selenium driver. So I'm not sure whether my approach is suitable for Selenium 1.xx</p> <p>The problem was in clicking invisible menu elemnt , which appears on mouse hover event. The solution I found for Firefox selenium driver:</p> <pre><code>WebElement mnuElement; WebElement submnuElement; mnEle = driver.findElement(By.Id("mnEle")).Click(); sbEle = driver.findElement(By.Id("sbEle")).Click(); Actions builder = new Actions(driver); // Move cursor to the Main Menu Element builder.MoveToElement(mnEle).Perform(); // Giving 5 Secs for submenu to be displayed Thread.sleep(5000L); // Clicking on the Hidden SubMenu driver.findElement(By.Id("sbEle")).Click(); </code></pre> <p>Here's the <a href="http://www.anitpatel.net/2012/02/25/selenium-webdriver-how-to-click-on-a-hidden-link-or-menu/" rel="nofollow">link</a></p> <p>Main idea is to create instance of Actions and try to focus on your element and click it. I would act in the following way: //find xpath of your invisible element:</p> <pre><code> String xpathInvisible = "//*[id="calendar"]/div/div/div/div[1]"; //find xpath of the element, on hovering which your invisible (inactive) element appear. I mean somthing //like VDIs (see my screen) on pressing which menu elements appear. String xpathCalendarToAppear ="....."; WebElement calendarToAppear= driver.findElement(By.xpath(xpathCalendarToAppear)); WebElement invisibleElement=driver.findElement(By.xpath(xpathInvisible)); Actions builder = new Actions(driver); builder.MoveToElement(calendarToAppear).Perform(); // Giving 5 Secs for submenu to be displayed Thread.sleep(5000L); // Clicking on the Hidden SubMenu invisibleElement.Click(); </code></pre> <p>In firefox this works OK. But IE driver has problems with clicking on elements. So I overcome this "IE problem" using jscript directly in the following way:</p> <pre><code>WebElement hiddenWebElement =driver.findElement(By.xpath(....)); ((JavascriptExecutor)driver).executeScript("arguments[0].click()",hiddenWebElement); </code></pre> <p>we initialize hiddenWebElement variable with element we want to click on. And using jscript we click on it.</p> <p>Hope this helps you.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload