Created
March 13, 2015 16:29
-
-
Save johnmmoss/8ae6afe7260a42cf12d6 to your computer and use it in GitHub Desktop.
Selenium API Test if a component is visible
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check if the provided value exists in an html table cell | |
public bool RowExists(string value) | |
{ | |
try | |
{ | |
var rowXPath = string.Format("//tr[td[normalize-space(text())='{0}']]", value); | |
webDriver.FindElement(By.XPath(rowXPath)); | |
return true; | |
} | |
catch (NoSuchElementException) | |
{ | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment