OriginalPostID-144422
Discussion posts and replies are publicly visible
Hello,
When using Xpath, confirming the Xpath script is very important to make sure that Selenium IDE, WebDriver or Selenium RC can identify the xpath locator during the test.
QA Engineers can use Xpath Checker to confim xpath. Xpath Checker needs to be installed on Firefox because it is an add on.
For example, on Wikipedia page, there is a link named "English". When using xpath, we can use the script below.
xpath=//div/a[text()="English"]
Thanks.
Hello
It is a best practice to have dedicated test users created within Appian course based on the roles you are testing. Most Appian end-users are set up as basic users so they can only see relevant and contextual data in enterprise environments. However, Appian Designers usually have system administrator privileges, so permissions errors and similar misconfigurations can be missed if we don’t test using roles that have limited permissions.
Instead of relying solely on attributes like id or class, you can try to identify elements based on their text content. For example, in your case, you have a radio button with options "Yes" and "No." You could use a CSS selector or XPath that targets these radio buttons based on their labels.
// Example CSS selector WebElement radioButtonYes = driver.findElement(By.cssSelector("span.gwt-RadioButtonLabel:contains('Yes')")); // Example XPath WebElement radioButtonNo = driver.findElement(By.xpath("//span[@class='gwt-RadioButtonLabel'][contains(text(), 'No')]"));
Also, you can use relative XPath expressions (read here- mlops training) that are based on the known surrounding elements or structures. This can make your XPath more robust against changes in the HTML structure.
WebElement radioButtonYes = driver.findElement(By.xpath("//div[@class='aui-RadioButtonGroup']//span[contains(text(), 'Yes')]"));