Class SimpleCommandDispatcher
-
- All Implemented Interfaces:
public final class SimpleCommandDispatcherDispatches web driver commands provided in text format.
This class serves as a bridge between text-based automation commands and WebDriver actions. It parses string commands and executes the corresponding WebDriver methods, enabling script-based control of browser automation.
Vincent Zhang
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classSimpleCommandDispatcher.Companion
-
Field Summary
Fields Modifier and Type Field Description public final static SimpleCommandDispatcher.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description SimpleCommandDispatcher()
-
Method Summary
-
-
Method Detail
-
execute
final Object execute(String command, WebDriver driver)
Executes a WebDriver command provided as a text string.
Parses the command string to extract the function name and arguments, then invokes the corresponding WebDriver method. For example, the string "driver.open('https://example.com')" would be parsed and the driver.open() method would be called with the URL argument.
- Parameters:
command- The command in text format (e.g., "driver.method(arg1, arg2)").driver- The WebDriver instance to execute the command on.- Returns:
The result of the command execution, or null if the command could not be executed.
-
-
-
-