I want to click "Action" button and select the option "Update Reference data".
Here is my code
Thread.sleep(30000);// To load the page
driver.findElement(By.xpath("//*[@id=\"spend_mgmt_actions_menu\"]")).click();
Thread.sleep(2000);
driver.findElement(By.xpath("//*[id=\"upgradeRefData_button\"]")).click();
I also tried this, but got the same exception
WebDriverWait wait = new WebDriverWait(driver, 10);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@id=\"spend_mgmt_actions_button\"]")));
driver.findElement(By.className("button show-right-icon f-dropdown-facade actions-list-button plan-action-button")).click();
Thread.sleep(20000);
But when I run the code it gives:
No Such Element Exception unable to locate.....
Below is the HTML code copied from browser by selecting the element.
<button id="spend_mgmt_actions_button"
class="button show-right-icon f-dropdown-facade actions-list-button plan-action-button"
aria-hidden="false" aria-haspopup="true" data-dropdown="spend_mgmt_actions_menu" tabindex="0">
<span>Actions</span><span class="icon icon-right fa fa-caret-down"></span></button>
<button id="upgradeRefData_button" class="list-item dd-item" aria-disabled="false"
data-dropdown-item="" role="menuitem" tabindex="0" title=""><span>Update Reference Data</span>
</button>