Thursday, January 3, 2013

isElementPresent? Method another way





“we can use the findElements() call, and then we just need to check that the size of the list returned is 0.

You can write logic like this.

List elements = driver.findElements(By.Id("element id"));
if(elements.size()==0)
        No element found
else
        Element found



No comments:

Post a Comment

Note: Only a member of this blog may post a comment.