Class: Stagehand::Models::Action

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/stagehand/models/action.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(description:, selector:, arguments: nil, backend_node_id: nil, method_: nil) ⇒ Object

Action object returned by observe and used by act

Parameters:

  • description (String)

    Human-readable description of the action

  • selector (String)

    CSS selector or XPath for the element

  • arguments (Array<String>) (defaults to: nil)

    Arguments to pass to the method

  • backend_node_id (Float) (defaults to: nil)

    Backend node ID for the element

  • method_ (String) (defaults to: nil)

    The method to execute (click, fill, etc.)



# File 'lib/stagehand/models/action.rb', line 36

Instance Attribute Details

#argumentsArray<String>?

Arguments to pass to the method

Returns:

  • (Array<String>, nil)


22
# File 'lib/stagehand/models/action.rb', line 22

optional :arguments, Stagehand::Internal::Type::ArrayOf[String]

#backend_node_idFloat?

Backend node ID for the element

Returns:

  • (Float, nil)


28
# File 'lib/stagehand/models/action.rb', line 28

optional :backend_node_id, Float, api_name: :backendNodeId

#descriptionString

Human-readable description of the action

Returns:

  • (String)


10
# File 'lib/stagehand/models/action.rb', line 10

required :description, String

#method_String?

The method to execute (click, fill, etc.)

Returns:

  • (String, nil)


34
# File 'lib/stagehand/models/action.rb', line 34

optional :method_, String, api_name: :method

#selectorString

CSS selector or XPath for the element

Returns:

  • (String)


16
# File 'lib/stagehand/models/action.rb', line 16

required :selector, String