Can't click at Menu and Submenu in IE 11

31 views
Skip to first unread message

DonJay

unread,
Jul 2, 2018, 4:12:53 PM7/2/18
to Selenium Users
<li id="menu_project" style="display: block; position: relative; top: 0px; z-index: 1; float: left;" class="submenu-down">
                <a href="#menu_projects" style="display: block;">Projects</a>
                <ul style="display: block; visibility: hidden; zoom: 1; opacity: 0; position: absolute; top: 26px; left: 0px; margin-left: 0px;">
                    
                    <li style="visibility: hidden; zoom: 1; opacity: 0; position: relative; display: block; top: 0px; z-index: 1;">
                        <a href="/new/search/project_search_new.html" style="display: block;">Project Search</a>
                    </li>
                    
                    
                    <li style="visibility: hidden; zoom: 1; opacity: 0; position: relative; display: block; top: -27px; z-index: 1;">
                        <a href="/new/add/project_add.html" style="display: block;">Add Project</a>
                    </li>
                    
                
                    <li style="visibility: hidden; zoom: 1; opacity: 0; position: relative; display: block; top: -81px; z-index: 1;">
                        <a href="/new/group/group_add.html" style="display: block;">Add Project Group</a>
                    </li>
                    
                                  
                </ul>
            </li>

I tried to click at or hover over the menu "Projects" and then click at the submenu "Project Search" but it is not possible. I have done all the configuration for Selenium to work in IE11 Browser and still no luck.

I tried the following methods but none worked. The test fails at the point of clicking at the menu;

public void executeClick (WebDriver driver, WebElement elems) {
        Actions actions = new Actions(driver);
        actions.moveToElement(elems).click().build().perform();
    }
     
     
public static JavascriptExecutor javaScriptClickElementID(WebDriver driver, String element) {
         
        JavascriptExecutor jse = (JavascriptExecutor)driver;
        jsElement = (JavascriptExecutor) jse.executeScript("return document.getElementById('"+element+"').click();");
         
        return jsElement;
    }
 
 
public void robotExecute(WebDriver driver, WebElement element) throws AWTException {
        Robot robot = new Robot();
        Actions actions = new Actions(driver);
        actions.moveToElement(element).build().perform();
        robot.keyPress(KeyEvent.VK_ENTER);
        robot.keyRelease(KeyEvent.VK_ENTER);
    }   
 
I am testing under the following environments;
  •     Selemnium 3.8.1
  •     Internet Explorer 11
  •     Windows7 Environment

Thanks in advance for the help
Reply all
Reply to author
Forward
0 new messages