The set of Selenide hacks
Requires Java 8+ version. Just add Selenide and Selenide hacks dependencies (versions correspond to the Selenide version).
The Selenide Command
with custom arguments. You can use CustomArgsCommand.of(Command, Object[])
method or
CustomArgsCommandOf(Command, Object[])
constructor.
SelenideElement element = driver.$(".class_name");
element.execute(
CustomArgsCommand.of(new Append(), "text to append"),
Duration.ofSeconds(20)
);
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.
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));
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.
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);