You could alternatively do:
driver.findElements(By.id("...")).size() != 0
Which saves the nasty try/catch
P.S.:
Or more precisely by @JanHrcek here
!driver.findElements(By.id("...")).isEmpty()
You could alternatively do:
driver.findElements(By.id("...")).size() != 0
Which saves the nasty try/catch
P.S.:
Or more precisely by @JanHrcek here
!driver.findElements(By.id("...")).isEmpty()