kurri kurri -4 years ago 95
Javascript Question

How to Click Sub Menu Link in Main Menu

I am trying to Click on Sub Menu. But it is not allowing to me Click and disappearing. In Console it is showing :

Element Not Visible exception.

Here is
Code :

<a href="/web/billing/storageHandlingRate">
<img class="navIcon" src="/web/images/nav/subChargeRuleMaintenance.png"/>
Storage Handling Rate

Xpath I am using :


Answer Source

(Assuming you're using Java) You should try using WebDriverWait to wait until element visible and clickable as below :-

new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.xpath(".//a[contains(.,'Storage Handling Rate')]"))).click();


new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.partialLinkText("Storage Handling Rate"))).click();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download