https://github.com/evpl/selenide-hacks
The set of Selenide hacks
https://github.com/evpl/selenide-hacks
automated-testing java selenide selenide-framework selenide-java
Last synced: 6 months ago
JSON representation
The set of Selenide hacks
- Host: GitHub
- URL: https://github.com/evpl/selenide-hacks
- Owner: evpl
- License: apache-2.0
- Created: 2022-11-02T16:38:51.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-03-07T04:05:44.000Z (over 3 years ago)
- Last Synced: 2025-07-31T23:14:59.019Z (12 months ago)
- Topics: automated-testing, java, selenide, selenide-framework, selenide-java
- Language: Java
- Homepage:
- Size: 31.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Selenide hacks
*The set of Selenide hacks*
[](https://maven-badges.herokuapp.com/maven-central/com.plugatar/selenide-hacks)
[](https://javadoc.io/doc/com.plugatar/selenide-hacks)
[](https://opensource.org/licenses/Apache-2.0)
[](https://hitsofcode.com/github/evpl/selenide-hacks/view?branch=master)
[](https://en.wikipedia.org/wiki/Source_lines_of_code)
## Table of Contents
* [How to use](#How-to-use)
* [API](#API)
* [CustomArgsCommand](#CustomArgsCommand)
* [UnsafeSelenideElement](#UnsafeSelenideElement)
* [OuterCommand](#OuterCommand)
## How to use
Requires Java 8+ version. Just add [Selenide](https://github.com/selenide/selenide) and Selenide hacks dependencies
(versions correspond to the Selenide version).
## API
### CustomArgsCommand
The Selenide `Command` with custom arguments. You can use `CustomArgsCommand.of(Command, Object[])` method or
`CustomArgsCommandOf(Command, Object[])` constructor.
```java
SelenideElement element = driver.$(".class_name");
element.execute(
CustomArgsCommand.of(new Append(), "text to append"),
Duration.ofSeconds(20)
);
```
### UnsafeSelenideElement
Represents an object that provides access to `SelenideElement` by method name and method arguments. You can
use `UnsafeSelenideElement.of(SelenideElement)` method or `UnsafeSelenideElementOf(SelenideElement)` constructor.
```java
SelenideElement element = driver.$(".class_name");
/* The first way */
UnsafeSelenideElement.of(element).invoke("append", "text to append");
/* The second way */
UnsafeSelenideElement.of(element).invoke(
"execute",
CustomArgsCommand.of(new Append(), "text to append"),
Duration.ofSeconds(20)
);
/* The third way */
UnsafeSelenideElement.of(element).invoke("append", "text to append", Duration.ofSeconds(20));
```
### OuterCommand
Represents `Command` that can be executed on an `SelenideElement`. You can use
`OuterCommand.of(String, Object[])` and `OuterCommand.of(Command, Object[])` methods or
`OuterCommandOf(String, Object[])` and `OuterCommandOf(Command, Object[])` constructor.
```java
SelenideElement element = driver.$(".class_name");
/* The first way */
OuterCommand.of("append", "text to append").executeOn(element);
/* The second way */
OuterCommand.of(
"execute",
CustomArgsCommand.of(new Append(), "text to append"),
Duration.ofSeconds(20)
).executeOn(element);
/* The third way */
OuterCommand.of("append", "text to append", Duration.ofSeconds(20)).executeOn(element);
```