Class: WebDriverScriptAdapter::FrameAdapter::SeleniumAdapter

Inherits:
DumbDelegator
  • Object
show all
Defined in:
lib/webdriver_script_adapter/frame_adapter.rb

Instance Method Summary collapse

Instance Method Details

#find_framesObject



54
55
56
# File 'lib/webdriver_script_adapter/frame_adapter.rb', line 54

def find_frames
  find_elements(:css, "iframe")
end

#within_frame(frame) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/webdriver_script_adapter/frame_adapter.rb', line 36

def within_frame(frame)
  switch_to.frame(frame)
  yield
ensure
  begin
    switch_to.parent_frame
  rescue => e
    if /switchToParentFrame|frame\/parent/.match(e.message)
      ::Kernel.warn "WARNING:
      This browser only supports first-level iframes.
      Second-level iframes and beyond will not be audited.
      To skip auditing all iframes,
      set Axe::Configuration#skip_iframes=true"
    end
    switch_to.default_content
  end
end