Skip to content

Instantly share code, notes, and snippets.

@guillaC
Created January 23, 2020 21:30
Show Gist options
  • Save guillaC/4d47eadf9b2fdc6b19f6515a9fb3a974 to your computer and use it in GitHub Desktop.
Save guillaC/4d47eadf9b2fdc6b19f6515a9fb3a974 to your computer and use it in GitHub Desktop.
selenium check if exist
private Boolean Exist(By by) //vérifie si un élément existe
{
try
{
this.driver.FindElement(by);
return true;
}
catch(Exception)
{
return false;
}
}
/*
usage:
while(!Exist(By.XPath("//table[@class='dataOutput']/tbody/tr[@class='dataRowEven']"))) { Thread.Sleep(1000); }
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment