Created
January 23, 2020 21:30
-
-
Save guillaC/4d47eadf9b2fdc6b19f6515a9fb3a974 to your computer and use it in GitHub Desktop.
selenium check if exist
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
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