I'm using Selenium to do some searching and testing on a web page. On this page there is a large number of elements that may or may not exist. Most of the time they do not exist but it is critical to find them when they do. I've used
WebElement.findElement(By);
WebElement.findElements(By);
WebDriver.findElement(By);
WebDriver.findElements(By);
All of these methods are very time consuming when they don't find any elements that match the By parameter. Is there a faster way? At this point I'm considering multithreading just for the elements that may or may not exist but that's a whole other can of worms I'd rather not open.
The linked duplicate question does not address the main issue of my question. That main issue being the time it takes for findElement and findElements to return when they don't find any elements.