Skip to content

Instantly share code, notes, and snippets.

@johnmmoss
Created March 13, 2015 16:26
Show Gist options
  • Save johnmmoss/734ab75cec857895b0b5 to your computer and use it in GitHub Desktop.
Save johnmmoss/734ab75cec857895b0b5 to your computer and use it in GitHub Desktop.
Selenium API Selecting a Button in a html column
// Click the a link of the tr where a td has a value of "Leeds", and the a link has the text "Edit"
var name = "Leeds";
var xpath = string.Format("//tr[td[normalize-space(text())='{0}']]/td/a[normalize-space(text()) = \"Edit\"]", name);
var editLink = webDriver.FindElement(By.XPath(xpath));
editLink.Click();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment