Interact with a Playwright ElementHandle.
There is no official channel documentation, since this is considered Playwright internal.
Summary
Functions
Releases this handle's browser reference. Already-closed targets are treated as successfully disposed; other errors are preserved.
Evaluates an expression on this element. A function receives the element and
the optional :arg. Returns the deserialized value or the original protocol error.
Sets the files on the input element represented by this handle.
Types
@type dispose_opt() :: {:connection, GenServer.name()} | {:timeout, timeout()}
@type evaluate_opt() :: {:connection, GenServer.name()} | {:timeout, timeout()} | {:expression, binary()} | {:is_function, boolean()} | {:arg, term()}
@type set_input_files_opt() :: {:connection, GenServer.name()} | {:timeout, timeout()} | {:local_paths, binary() | [binary()]} | {:payloads, PlaywrightEx.FilePayload.t() | [PlaywrightEx.FilePayload.t()]}
Functions
@spec dispose(PlaywrightEx.guid(), [dispose_opt()]) :: {:ok, any()} | {:error, any()}
Releases this handle's browser reference. Already-closed targets are treated as successfully disposed; other errors are preserved.
Options
@spec evaluate(PlaywrightEx.guid(), [evaluate_opt() | PlaywrightEx.unknown_opt()]) :: {:ok, any()} | {:error, any()}
Evaluates an expression on this element. A function receives the element and
the optional :arg. Returns the deserialized value or the original protocol error.
Options
:connection(term/0) - The Connection process name. Defaults toPlaywrightEx.Supervisor.Connection. The default value isPlaywrightEx.Supervisor.Connection.:timeout(timeout/0) - Required. Operation timeout in milliseconds.0means no waiting;:infinitydisables the timeout.:expression(String.t/0) - Required.:is_function(boolean/0) - The default value isfalse.:arg(term/0) - The default value isnil.
@spec set_input_files(PlaywrightEx.guid(), [ set_input_files_opt() | PlaywrightEx.unknown_opt() ]) :: {:ok, any()} | {:error, any()}
Sets the files on the input element represented by this handle.
Pass either :local_paths or :payloads. An empty list clears the selected
files. This operation can be used with the element handle carried by a
subscribed page's :file_chooser event.
Reference: https://playwright.dev/docs/api/class-filechooser#file-chooser-set-files
Options
:connection(term/0) - The Connection process name. Defaults toPlaywrightEx.Supervisor.Connection. The default value isPlaywrightEx.Supervisor.Connection.:timeout(timeout/0) - Required. Operation timeout in milliseconds.0means no waiting;:infinitydisables the timeout.:local_paths- A file path or list of file paths. Relative paths are resolved relative to the current working directory. An empty list clears the selected files.:payloads(PlaywrightEx.FilePayload.t() | [PlaywrightEx.FilePayload.t()]) - An in-memory file payload or list of payloads. An empty list clears the selected files.