(Selenium WebDriver) Menu click pass but nothing happens on page

(Selenium WebDriver) Menu click pass but nothing happens on page

azharuddin1azharuddin1 Posts: 1Questions: 1Answers: 0

I am writing a selenium C# test code for an old "infragistics" (I seriouly don't know too much about this) page. The page doesn't give me that much options when it comes to elements references. Like in the HTML below I want to click on INVENTORY which is a submenu of a menu item but there is no element Id or Name so I used XPath (see code below). It looks like webdriver recognizes that xpath but when the click function executes and complete, nothing happens on the page. It does not open the expected page. Is there something that I am doing wrong here?

<li class="igdm_MenuItemVertical igdm_MenuItemVerticalParent " unselectable="on" data-ig="x:1171509256.11:adr:1.2" adr="1.2"><A onclick="{return false;}" tabIndex=-1 class="igdm_MenuItemVerticalLink " href="#/Inventory...">
<a onclick="{return false;}" tabIndex=-1 class="igdm_MenuItemVerticalLink>
<img class="igdm_MenuItemVerticalIcon " alt=" Inventory..." src="../Images/report16.gif">
<span tabIndex=-1 unselectable="on"> INVENTORY...</span>
</a>
Run code snippetExpand snippet
Code:

private By FileSubMenu = By.XPath(".//li/a/span[text()=' Inventory...']");

public HomePage SubMenu()
{
    int retryCount = 0;
    while (true && retryCount < Constants.RETRY_COUNT)
    {
        try
        {
            Thread.Sleep(3000);
            IWebElement element = _driver.FindElement(FileSubMenu);
            Actions Rmouseover = new Actions(_driver);
            Rmouseover.MoveToElement(element).Click().Perform();
            return this;
        }
        catch (Exception ex) when (ex is WebDriverTimeoutException || ex is TimeoutException)
        {
            retryCount++;
            Thread.Sleep(3000);
        }
    }
    return this;
}

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi azharuddin1,

    This seems like a generic Selenium question, and not specific to DataTables, so it would be worth asking on StackOverflow.

    Cheers,

    Colin

This discussion has been closed.