cdp4j

cdp4j is a Java library which provides a high-level API to control Chrome or Chromium over the DevTools Protocol. It can be used for automating the use of web pages and for testing web pages. cdp4j runs full by default, but can be configured to run headless Chrome or Chromium.

What can i do

Most things that you can do manually in the browser can be done using cdp4j. Here are a few examples to get you started:

  • Generate screenshots and PDFs of pages.
  • Crawl a Single-Page Application and generate pre-rendered content (Server-Side Rendering).
  • Automate form submission, UI testing, keyboard input, etc.
  • Create an up-to-date, automated testing environment.
  • Run your tests directly in the latest version of Chromium using the latest JavaScript and browser features.

Features

  • Supports full capabilities of the Chrome DevTools Protocol (tip-of-tree)
  • Evaluate JavaScript
  • Invoke JavaScript function
  • Supports native CSS selector engine
  • Supports Sizzle selector engine
  • Supports XPath queries
  • Incognito Browsing (private tab)
  • Full page screen capture
  • Trigger Mouse events (click etc...)
  • Send keys (text, tab, enter etc...)
  • Redirect log entries (javascript, network, storage etc...) from browser to slf4j
  • Intercept Network (request & response)
  • Upload file programmatically without third party solutions (does not requires AWT Robot etc...)
  • get & set Element properties
  • Supports Headless Chrome/Chromium
  • Navigate back, forward, stop, reload
  • clear cache, clear cookies, list cookies
  • set & get values of form elements
  • Supports event handling
  • Supports all well known Java WebSocket libraries.

Supported Java Versions

Oracle/OpenJDK 8+, GraalVM & native-image.

Both the JRE and the JDK are suitable for use with this library.

Supported Platforms

Windows, Linux and macOS.

Design Principles

We focus on providing lightweight and robust solutions with an emphasis on speed, size, portability, features, and standards compliance.

Here are major design principles of cdp4j:

  • Avoid external dependencies as much as possible.
  • Support only Chrome/Chromium based browsers.
  • cdp4j supports all capabilities of the Chrome DevTools Protocol.
  • Keep the API simple.

Licensing

cdp4j is licensed as Commercial License.
Buying a license is mandatory as soon as you develop commercial activities to distribute the cdp4j software inside your product or deploy it on a network.

Trial Download

Download cdp4j trial version
Release Date: August 24, 2021
Version: 5.4
File Size: 1.2 MB
The archive file contains both the cdp4j library and example source codes.
Relase Notes