Using latest version of Webdriver 2.33 were checked out following solution :
1. using javascript for making clickable menu item visible :
public void setElementVisible(WebElement el) {
String js = "arguments[0].style.height='auto'; arguments[0].style.visibility='visible';";
((JavascriptExecutor) driver).executeScript(js, el);
}
....
WebElement menuitem = driver.findElement(By.xpath("//div[@id='module-menu']/ul/li[a[text()='Content']]/ul/li/a[text()='Article Manager']"));
setElementVisible(menuitem);
menuitem.click();
....
2. using Actions for cascade access to requested menu item :
public void clickThreeLevelMenu (String level1Text, String level2Text, String level3Text) {
WebElement el = driver.findElement(By.xpath("//a[text()='" + level1Text + "']"));
WebElement el2 = driver.findElement(By.xpath("//a[text()='" + level2Text + "']"));
Actions acts = new Actions(driver);
WebElement el3 = driver.findElement(By.xpath("//a[text()='" + level3Text + "']"));
acts.moveToElement(el).moveToElement(el2).moveToElement(el3).click().build().perform();
}
Both shown solutions helped to solve some specific obstacles but sometimes still happens the test run stop because of error "cannot find the reqested element". Joomla site response time varies very heavy and find the proper adjustment was difficult.
As the final solution was taken case #1 with implemented wait condition, using contains(text(),..) Xpath function and direct click on clickable menu item by javascript :
public void clickTwoLevelMenu(String level1Text, String level2Text) {
WebElement menuitme = Do.elementXpathWait("//div[@id='module-menu']/ul/li[a[text()='" + level1Text + "']]/ul/li/a[contains(text(),'" + level2Text + "')]");
String js = "arguments[0].style.height='auto'; arguments[0].style.visibility='visible';arguments[0].click();";
((JavascriptExecutor) driver).executeScript(js, menuitme);
}
Final test code was used in different use cases with good, stable operation.