
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
com.chavaillaz:automated-browser
Advanced tools
This library allows to quickly do an automated application controlling a browser for multiple purposes. An example of usage is to automate the generation of reports for external parties by accessing internal services, highlighting elements, taking screenshots and creating documents with them.
The dependency is available in maven central (see badge for version):
<dependency>
<groupId>com.chavaillaz</groupId>
<artifactId>automated-browser</artifactId>
</dependency>
An example of usage is available in the MavenCentralTest class. Its goal is to search the last version of a Maven
artifact and take a screenshot of the code snippet to use.
In order to benefit from this library, create new classes extending AutomatedBrowser and use the methods available in
it to simplify the implementation of your requirements.
An example of extension available in the tests of the project is the MavenCentral class. It can be used with:
try (MavenCentral browser = new MavenCentral(driver)) {
browser.searchArtifact("org.slf4j:slf4j-api");
}
There is also a possibility to have a flow with multiple steps defining your requirements, using the classes extending
AutomatedBrowser you created:
try (MavenCentral browser = new MavenCentral(driver)) {
browser.setData(new MavenCentralData("org.slf4j:slf4j-api"));
new AutomatedBrowserFlow<>(browser)
.withStep(MavenCentral::stepSearchArtifact)
.withStep(MavenCentral::stepLogLastVersion)
.withStep(MavenCentral::stepHighlightSnippet);
}
Note that you can also give a default exception handler for all step or a specific one overriding it for some steps.
Also with the same flow system, you can have stateless calls to static methods. Those methods can have:
AutomatedBrowser you gave in the constructor (defaulting to AutomatedBrowser)withContext methodtry (MavenCentral browser = new MavenCentral(driver)) {
new AutomatedBrowserFlow<MavenCentral, MavenCentralData>(browser)
.withContext(new MavenCentralData("org.slf4j:slf4j-api"))
.withStep(MavenCentralStep::stepSearchArtifact)
.withStep(MavenCentralStep::stepLogLastVersion)
.withStep(MavenCentralStep::stepHighlightSnippet);
}
Creates your preferred the driver using the methods in BrowserUtils:
getChromeDriver)getFirefoxDriver)getEdgeDriver)Then pass it to the classes you created (see chapter above) and start using them directly. Note that this will use the browsers available on your computer, meaning when you choose a browser driver in the code, you need that browser installed on your computer to make it working.
Thanks to test containers, you can also directly run it in a docker container containing the browser you want to use. For that, include the following dependencies in your project:
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>selenium</artifactId>
<version>${test-containers.version}</version>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${test-containers.version}</version>
</dependency>
When it's done, add the @Testcontainers annotation on your test classes and the following attribute for the
container (in this example Google Chrome):
@Container
public BrowserWebDriverContainer<?> chrome = new BrowserWebDriverContainer<>()
.withCapabilities(getChromeOptions())
.withRecordingMode(SKIP, null);
You can then access the driver with chrome.getWebDriver() and pass it when instantiating your classes.
If you have a feature request or found a bug, you can:
If you want to contribute then
mvn testThis project is under Apache 2.0 License.
FAQs
Library to automate a browser for multiple purposes
We found that com.chavaillaz:automated-browser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.