How to click on the above Menu Layout Button? using the Appian Selenium
Discussion posts and replies are publicly visible
Hi anbus0002 ,Identify a Unique XPath/CSS Selector for the Menu Layout Button.Check the following Selenium code if you are trying to test or using RPA:
WebDriver driver = AppianObjectRepository.getWebDriver(); WebElement menuButton = driver.findElement(By.xpath("//button[contains(@class, 'Button---secondary') and contains(@class, 'Button---small') and contains(@class, 'Button---with_icon')]")); menuButton.click();
If it's RPA, then you can refer this link - Browser Java ModuleNote: The above code is just for reference, identify exact relative xpath !!!
Identifying a button in Appian using Selenium can be more challenging than in traditional applications because Appian generates its UI dynamically and many CSS classes can change frequently. Here are some effective and stable ways to locate buttons:
1. Locate by visible textIf the button has visible text, you can use XPath:
driver.find_element(By.XPATH, "//button[normalize-space()='ButtonName']")
If it’s not a <button> element but a <div>, <a>, or similar:
driver.find_element(By.XPATH, "//*[text()='ButtonName']")
2. Use stable attributesLook for attributes like:
aria-label
title
id (if not dynamic)
data-*
Example:
driver.find_element(By.CSS_SELECTOR, "[aria-label='Save']")
The Appian Selenium API has javadocs in the download. Have you tried the following?
public void clickOnRecordActionFieldMenuAction​(java.lang.String indexOfField, java.lang.String action)
| click on record action field | [INDEX] | menu action | ACTION_NAME or [INDEX] |
indexOfField
action