Class: OmniAI::Tools::Browser::ClickTool

Inherits:
BaseTool
  • Object
show all
Defined in:
lib/omniai/tools/browser/click_tool.rb

Overview

Examples:

browser = Watir::Browser.new(:chrome)
tool = OmniAI::Tools::Browser::ClickTool.new(browser:)
tool.execute(selector: "#some-id")
tool.execute(selector: ".some-class")
tool.execute(selector: "some text")
tool.execute(selector: "//div[@role='button']")

Instance Method Summary collapse

Methods inherited from BaseTool

#initialize

Constructor Details

This class inherits a constructor from OmniAI::Tools::Browser::BaseTool

Instance Method Details

#execute(selector:) ⇒ Object

Parameters:

  • selector (String)

    CSS selector, ID, text content, or other identifier for the element to click.



29
30
31
32
33
# File 'lib/omniai/tools/browser/click_tool.rb', line 29

def execute(selector:)
  @logger.info("#{self.class.name}##{__method__} selector=#{selector.inspect}")

  @driver.click(selector:)
end