Reputation: 57
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 HTML
Code :
<a href="/web/billing/storageHandlingRate">
<img class="navIcon" src="/web/images/nav/subChargeRuleMaintenance.png"/>
Storage Handling Rate
</a>
Xpath I am using :
xpath(".//*[@id='globalMenuNavigation']/li[2]/ul/li[7]/a")
Upvotes: 0
Views: 155
Reputation: 23805
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();
Or
new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.partialLinkText("Storage Handling Rate"))).click();
Upvotes: 1