Skip to content

Latest commit

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Smart Selenium

When working with Selenium, it's common to run into these unbearable problems:

  • WebElement#click throws ElementClickInterceptedException for no apparent reason.
  • It's impossible to keep elements in memory because they're tied to the current page - causing StaleElementReferenceException.

While some can be resolved using a util class, others require an ugly architectural refactor on your end.
This library ends the misery by changing 1 line of your code.

Usage

All you need to do is create your WebDriver like this:

WebDriverdriver = WebDriverFactory.smartify(yourWebDriver);

and suddenly this is possible:

driver.get("www.website.com");
WebElementelement = driver.findElement(someLocator);
driver.get("www.anotherWebsite.com");
//without the library -> throws StaleElementReferenceExceptionSystem.out.println(element.getText());

Behind the scenes

The library wraps WebDriver methods that produce WebElement objects with smart wrappers - so your code doesn't change!
The elements package contains the juice.

Import

Maven:

<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<dependency>
<groupId>com.github.DavidTheExplorer</groupId>
<artifactId>Smart-Selenium</artifactId>
<version>[latest-version]</version>
</dependency>

About

Get rid of common Selenium problems by changing 1 line of your code.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages