All Projects → webfolderio → Ui4j

webfolderio / Ui4j

Licence: mit
Web Automation for Java

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Ui4j

Headless Burp
Automate security tests using Burp Suite.
Stars: ✭ 192 (-4.95%)
Mutual labels:  automation
Ansible Rails
Ruby on Rails deployment using Ansible - with Lets Encrypt, Sidekiq, PostgreSQL, nginx & puma
Stars: ✭ 199 (-1.49%)
Mutual labels:  automation
Vocabhunter
VocabHunter helps learners of foreign languages find vital new vocabulary to study.
Stars: ✭ 201 (-0.5%)
Mutual labels:  javafx
Mudpi Core
Configurable automation library for linux SBC boards including raspberry pi
Stars: ✭ 194 (-3.96%)
Mutual labels:  automation
Replica
Ghidra Analysis Enhancer 🐉
Stars: ✭ 194 (-3.96%)
Mutual labels:  automation
Reporting
Zebrunner Reporting Tool
Stars: ✭ 198 (-1.98%)
Mutual labels:  automation
Thirtyfour
Selenium WebDriver client for Rust, for automated testing of websites
Stars: ✭ 191 (-5.45%)
Mutual labels:  automation
Nvidia Sniper
🎯 Autonomously buy Nvidia Founders Edition GPUs as soon as they become available.
Stars: ✭ 193 (-4.46%)
Mutual labels:  automation
Python Scripts
Collection of Various Python Script's.💻
Stars: ✭ 195 (-3.47%)
Mutual labels:  automation
Zbn
安全编排与自动化响应平台
Stars: ✭ 201 (-0.5%)
Mutual labels:  automation
Allure Docker Service
This docker container allows you to see up to date reports simply mounting your "allure-results" directory in the container (for a Single Project) or your "projects" directory (for Multiple Projects). Every time appears new results (generated for your tests), Allure Docker Service will detect those changes and it will generate a new report automatically (optional: send results / generate report through API), what you will see refreshing your browser.
Stars: ✭ 194 (-3.96%)
Mutual labels:  automation
Mosint
An automated e-mail OSINT tool
Stars: ✭ 184 (-8.91%)
Mutual labels:  automation
Add And Commit
Add & commit files from a path directly from GitHub Actions
Stars: ✭ 198 (-1.98%)
Mutual labels:  automation
Dotnet Testcontainers
A library to support tests with throwaway instances of Docker containers for all compatible .NET Standard versions.
Stars: ✭ 195 (-3.47%)
Mutual labels:  automation
Powershell Scripts
PowerShell scripts ranging from SCCM, MSO, AD, and other corporate enterprise uses... to sending cat facts to coworkers.
Stars: ✭ 201 (-0.5%)
Mutual labels:  automation
Platypush
A versatile and extensible platform for home and life automation with hundreds of supported integrations
Stars: ✭ 192 (-4.95%)
Mutual labels:  automation
Bigkeeper
Efficiency improvement for iOS&Android modular development.
Stars: ✭ 198 (-1.98%)
Mutual labels:  automation
Sfdx Mass Action Scheduler
🚀 Declaratively schedule Process Builder, Flows, Quick Actions, Email Alerts, Workflow Rules, or Apex to process records from Reports, List Views, SOQL, or Apex.
Stars: ✭ 200 (-0.99%)
Mutual labels:  automation
Autotorrent
Matches torrents with files and gets them seeded
Stars: ✭ 200 (-0.99%)
Mutual labels:  automation
Python Novice Inflammation
Programming with Python
Stars: ✭ 199 (-1.49%)
Mutual labels:  automation

Ui4j

License FOSSA Status

Ui4j is a web-automation library for Java. It is a thin wrapper library around the JavaFx WebKit Engine, and can be used for automating the use of web pages and for testing web pages.

cdp4j (Automation for Chrome & Chromium)

Use cdp4j Java library if you need to automate Chrome or Chromium based browsers.

Supported Java Versions

Oracle & OpenJDK Java 8 and 11.

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

Licensing

Ui4j is licensed as MIT software.

Stability

This library is suitable for use in production systems.

Integration with Maven

To use the official release of ui4j, please use the following snippet in your pom.xml file.

Add the following to your POM's tag:

<dependency>
    <groupId>io.webfolder</groupId>
    <artifactId>ui4j-webkit</artifactId>
    <version>4.0.0</version>
</dependency>

Download

ui4j-webkit-4.0.0.jar - 387 KB

ui4j-webkit-4.0.0-sources.jar - 196 KB

Supported Platforms

Ui4j has been tested under Windows 10 but should work on any platform where a Java 8 or Java 11 is available.

Headless Mode

Ui4j can be run in "headless" mode using Monocle.

  1. Add maven dependency of the latest openjfx-monocle.
  2. Add -Dui4j.headless Java system parameter from command line or with using api System.setProperty("ui4j.headless", "true");

Logging

Both simple logger for java (SLF4J) and Java utility logger (JUL) is supported. If slf4j is available on classpath io.webfolder.ui4j.api.util.LoggerFactory use slf4j else java utility logger is used.

CSS Selector Engine

Ui4j use W3C selector engine which is default selector engine of WebKit. Alternatively Sizzle selector engine might be used. Sizzle is the css selector engine of JQuery and it supports extra selectors like :has(div), :text, contains(text) etc. Check the Sizzle.java for using sizzle with Ui4j.

Usage Examples

Here is a very basic sample program that uses Ui4j to display a web page with a "hello, world!" message. See the ui4j-sample project for more sample code snippets.

// get the instance of the webkit
BrowserEngine browser = BrowserFactory.getWebKit();
// navigate to blank page
Page page = browser.navigate("about:blank");
// show the browser page
page.show();
// append html header to the document body
page.getDocument().getBody().append("<h1>Hello, World!</h1>");

Here is another sampe code that list all front page news from Hacker News.

try (Page page = getWebKit().navigate("https://news.ycombinator.com")) {
    page
        .getDocument()
        .queryAll(".title a")
        .forEach(e -> {
            System.out.println(e.getText());
        });
}

Building Ui4j

mvn package

FAQ

How can i set the user agent string?

See UserAgent.java sample.

How can i execute javascript?

See JavaScriptExecution.java sample.

How can i handle browser login, prompt or confirmation dialog?

See DialogTest.java for custom handlers or use default handlers from Dialogs.java.

What is the easiest way clear all input elements?

Use clear method of the Form class.

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].