Module: Selenium::WebDriver::Edge::Bridge

Defined in:
lib/selenium/webdriver/edge/bridge.rb

Instance Method Summary collapse

Instance Method Details

#commands(command) ⇒ Object


25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/selenium/webdriver/edge/bridge.rb', line 25

def commands(command)
  unsupported = %i[execute_script execute_async_script submit_element double_click
                   mouse_down mouse_up mouse_move_to click
                   send_keys_to_active_element get_window_handles get_current_window_handle
                   get_window_size set_window_size get_window_position set_window_position
                   maximize_window get_alert_text accept_alert dismiss_alert]
  if unsupported.include? command
    Remote::OSS::Bridge::COMMANDS[command]
  else
    super
  end
end

#maximize_window(handle = :current) ⇒ Object


69
70
71
# File 'lib/selenium/webdriver/edge/bridge.rb', line 69

def maximize_window(handle = :current)
  execute :maximize_window, window_handle: handle
end

#reposition_window(x, y, handle = :current) ⇒ Object


64
65
66
67
# File 'lib/selenium/webdriver/edge/bridge.rb', line 64

def reposition_window(x, y, handle = :current)
  execute :set_window_position, {window_handle: handle},
          {x: x, y: y}
end

#resize_window(width, height, handle = :current) ⇒ Object


52
53
54
55
56
# File 'lib/selenium/webdriver/edge/bridge.rb', line 52

def resize_window(width, height, handle = :current)
  execute :set_window_size, {window_handle: handle},
          {width: width,
           height: height}
end

#send_keys_to_active_element(key) ⇒ Object


38
39
40
# File 'lib/selenium/webdriver/edge/bridge.rb', line 38

def send_keys_to_active_element(key)
  execute :send_keys_to_active_element, {}, {value: key}
end

#window_handleObject


42
43
44
# File 'lib/selenium/webdriver/edge/bridge.rb', line 42

def window_handle
  execute :get_current_window_handle
end

#window_position(handle = :current) ⇒ Object


58
59
60
61
62
# File 'lib/selenium/webdriver/edge/bridge.rb', line 58

def window_position(handle = :current)
  data = execute :get_window_position, window_handle: handle

  Point.new data['x'], data['y']
end

#window_size(handle = :current) ⇒ Object


46
47
48
49
50
# File 'lib/selenium/webdriver/edge/bridge.rb', line 46

def window_size(handle = :current)
  data = execute :get_window_size, window_handle: handle

  Dimension.new data['width'], data['height']
end