title: Selenium webdriver Action not working with primefaces tieredmenu
body: <p>this is a well-known difficulty. I found several references (<a href="https://stackoverflow.com/questions/17293914/how-to-perform-mouseover-function-in-selenium-webdriver-using-java">here</a>, <a href="http://www.toolsqa.com/selenium-webdriver/mouse-hover-action/" rel="nofollow noreferrer">here</a> and <a href="http://seleniumeasy.com/selenium-tutorials/how-to-perform-mouseover-action-in-selenium-webdriver" rel="nofollow noreferrer">here</a>), but none seems to work with the scenario with which I am working.</p>
  
  <p>I have a menu made with Primefaces (tieredMenu). It renders a html as follows. I need to click on the second submenu item of the first menu item (<code>&lt;a class="ui-menuitem-link ui-corner-all configmenuPartner" onclick="PrimeFaces.ab({source:'frm:configmenuPartner',formId:'frm'});return false;" href="#" tabindex="-1"&gt;</code>).</p>
  
  <p>I'm using the following code (webdriver 2.44.0 - ie driver) to perform the action:</p>
  
  <pre><code>Actions action = new Actions(webdriver);
  WebElement mainMenu = webdriver.findElement(By.cssSelector("li.configmenu"));
  action.moveToElement(mainMenu).moveToElement(webdriver.findElement(By.cssSelector(".configmenuPartner"))).click().build().perform();
  </code></pre>
  
  <p>The first <strong>moveToElement</strong> seems to be working, since the correct submenu is rendered and shown, but instead of clicking into the second submenu, selenium "clicks" in the second item of the main menu (<code>&lt;li class="ui-widget ui-menuitem ui-corner-all ui-menu-parent" aria-haspopup="true" role="menuitem"&gt;</code>).</p>
  
  <p>I tried to use xpath, using By.xpath("//*[contains(@class, 'configmenuPartner')]") but the result was the same.</p>
  
  <p>Please, could you help me pointing out a path or showing me some mistake?</p>
  
  <p>TIA,</p>
  
  <p>Bob</p>
  
  <pre><code>&lt;div id="frm:mnuNsmg" class="ui-menu ui-tieredmenu ui-widget ui-widget-content ui-corner-all ui-helper-clearfix" role="menubar" style="width: 13.5em;"&gt;
     &lt;div class="ui-helper-hidden-accessible" tabindex="0"&gt;&lt;/div&gt;
        &lt;ul class="ui-menu-list ui-helper-reset"&gt;
           &lt;li class="ui-widget ui-menuitem ui-corner-all ui-menu-parent configmenu ui-menuitem-active" aria-haspopup="true" role="menuitem"&gt;
              &lt;a class="ui-menuitem-link ui-corner-all ui-state-hover" tabindex="-1" href="javascript:void(0)"&gt;&lt;/a&gt;
              &lt;ul class="ui-widget-content ui-menu-list ui-corner-all ui-helper-clearfix ui-menu-child ui-shadow" role="menu" style="left: 162px; top: 0px; z-index: 1031; display: block;"&gt;
                  &lt;li class="ui-menuitem ui-widget ui-corner-all" role="menuitem"&gt;&lt;/li&gt;
                  &lt;li class="ui-menuitem ui-widget ui-corner-all" role="menuitem"&gt;
                     &lt;a class="ui-menuitem-link ui-corner-all configmenuPartner" onclick="PrimeFaces.ab({source:'frm:configmenuPartner',formId:'frm'});return false;" href="#" tabindex="-1"&gt;&lt;/a&gt;
                  &lt;/li&gt;
                  &lt;li class="ui-menuitem ui-widget ui-corner-all" role="menuitem"&gt;&lt;/li&gt;
                  &lt;li class="ui-menuitem ui-widget ui-corner-all" role="menuitem"&gt;&lt;/li&gt;
                  &lt;li class="ui-menuitem ui-widget ui-corner-all" role="menuitem"&gt;&lt;/li&gt;
                  &lt;li class="ui-menuitem ui-widget ui-corner-all" role="menuitem"&gt;&lt;/li&gt;
                  &lt;li class="ui-menuitem ui-widget ui-corner-all" role="menuitem"&gt;&lt;/li&gt;
                  &lt;li class="ui-menuitem ui-widget ui-corner-all" role="menuitem"&gt;&lt;/li&gt;
                  ::after
              &lt;/ul&gt;
          &lt;/li&gt;
          &lt;li class="ui-widget ui-menuitem ui-corner-all ui-menu-parent" aria-haspopup="true" role="menuitem"&gt;&lt;/li&gt;
          &lt;li class="ui-menuitem ui-widget ui-corner-all" role="menuitem"&gt;&lt;/li&gt;
          &lt;li class="ui-menuitem ui-widget ui-corner-all" role="menuitem"&gt;&lt;/li&gt;
      &lt;/ul&gt;
      ::after
  &lt;/div&gt;&lt;/div&gt;
  </code></pre>