Sha256: a3007ccdfb3e2defdb7a809511fc16bd3dc8ade5135a721e8eb6f6e21cea08ea
Contents?: true
Size: 1.2 KB
Versions: 1
Compression:
Stored size: 1.2 KB
Contents
module RAutomation module Implementations module AutoIt class Button include WaitHelper include Locators # Special-cased locators LOCATORS = { :class_name => :classnn, :value => :text } # Possible locators are :text, :value, :id, :class, :class_name and :instance. def initialize(window, locators) @window = window extract(locators) end def click #:nodoc: clicked = false wait_until do @window.activate @window.active? && Window.autoit.ControlFocus(@window.locator_hwnd, "", @locators) == 1 && Window.autoit.ControlClick(@window.locator_hwnd, "", @locators) == 1 && clicked = true # is clicked at least once clicked && !exists? end end def value #:nodoc: Window.autoit.ControlGetText(@window.locator_hwnd, "", @locators) end def exists? #:nodoc: not Window.autoit.ControlGetHandle(@window.locator_hwnd, "", @locators).empty? end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rautomation-0.0.4 | lib/rautomation/implementations/autoit/button.rb |