I created selenium web driver project with maven. I read somewhere we need to add guava dependency.
Can anybody why we need guava dependency with selenium?
I created selenium web driver project with maven. I read somewhere we need to add guava dependency.
Can anybody why we need guava dependency with selenium?
This is the best information I can arrange.
Summarize Answer:
Selenium uses Guava libraries for
Function and Predicates
.
Reference for above quote (Page-126) :
Brief about Function and Predicates with example used in Selenium:
Guava provides two basic "functional" interfaces:
Example:
public WebElement apply(WebDriver driver) {
return driver.findElement(locator);
}
here you can also check. Mainly used in Selenium Waits (except implicit).
Example:
selenium filter with Predicate
here you can find details of Function and Predicates
on Guava
official Documentation
I hope it will help you.
Guava is an open source, Java-based library developed by Google. It facilitates developers and test automation engineers in adapting best coding practices and helps reduce coding errors. It provides utility methods for collections, caching, primitives support, concurrency, common annotations, string processing, I/O, and validations.
As of Selenium v3.141.59 clients the Maven Dependency is:
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>25.0-jre</version>
</dependency>
You can find a couple of relevant discussions in: