Class: Watir::IFrame

Inherits:
HTMLElement show all
Defined in:
lib/watir-webdriver/elements/iframe.rb,
lib/watir-webdriver/elements/generated.rb

Direct Known Subclasses

Frame

Constant Summary

Constants included from Atoms

Atoms::ATOMS

Instance Method Summary collapse

Methods inherited from HTMLElement

#access_key, #access_key_label, #command_checked?, #command_disabled?, #command_hidden?, #command_icon, #command_label, #command_type, #content_editable, #content_editable?, #context_menu, #dataset, #dir, #draggable?, #dropzone, #hidden?, #item_id, #item_prop, #item_ref, #item_scope?, #item_type, #item_value, #lang, #onabort, #onautocomplete, #onautocompleteerror, #onblur, #oncancel, #oncanplay, #oncanplaythrough, #onchange, #onclick, #onclose, #oncontextmenu, #oncuechange, #ondblclick, #ondrag, #ondragend, #ondragenter, #ondragexit, #ondragleave, #ondragover, #ondragstart, #ondrop, #ondurationchange, #onemptied, #onended, #onerror, #onfocus, #oninput, #oninvalid, #onkeydown, #onkeypress, #onkeyup, #onload, #onloadeddata, #onloadedmetadata, #onloadstart, #onmousedown, #onmouseenter, #onmouseleave, #onmousemove, #onmouseout, #onmouseover, #onmouseup, #onmousewheel, #onpause, #onplay, #onplaying, #onprogress, #onratechange, #onreset, #onresize, #onscroll, #onseeked, #onseeking, #onselect, #onshow, #onsort, #onstalled, #onsubmit, #onsuspend, #ontimeupdate, #ontoggle, #onvolumechange, #onwaiting, #properties, #spellcheck?, #tab_index, #title, #translate?

Methods inherited from Element

#==, #attribute_value, #browser, #class_name, #click, #double_click, #drag_and_drop_by, #drag_and_drop_on, #driver, #exists?, #fire_event, #flash, #focus, #focused?, #hash, #hover, #id, #initialize, #inner_html, #inspect, #outer_html, #parent, #present?, #right_click, #run_checkers, #select_text, #send_keys, #style, #tag_name, #text, #to_subtype, #value, #visible?, #wd

Methods included from AttributeHelper

#attribute, #attribute_list, #inherit_attributes_from, #method, #typed_attributes

Methods included from EventuallyPresent

#wait_until_present, #wait_while_present, #when_present

Methods included from Container

#a, #abbr, #abbrs, #address, #addresses, #area, #areas, #article, #articles, #as, #aside, #asides, #audio, #audios, #b, #base, #bases, #bdi, #bdis, #bdo, #bdos, #blockquote, #blockquotes, #body, #bodys, #br, #brs, #bs, #button, #buttons, #canvas, #canvases, #caption, #captions, #checkbox, #checkboxes, #cite, #cites, #code, #codes, #col, #colgroup, #colgroups, #cols, #data, #datalist, #datalists, #datas, #dd, #dds, #del, #dels, #details, #detailses, #dfn, #dfns, #dialog, #dialogs, #div, #divs, #dl, #dls, #dt, #dts, #element, #elements, #em, #embed, #embeds, #ems, #extract_selector, #field_set, #field_sets, #fieldset, #fieldsets, #figcaption, #figcaptions, #figure, #figures, #file_field, #file_fields, #font, #fonts, #footer, #footers, #form, #forms, #frame, #frames, #frameset, #framesets, #h1, #h1s, #h2, #h2s, #h3, #h3s, #h4, #h4s, #h5, #h5s, #h6, #h6s, #head, #header, #headers, #heads, #hgroup, #hgroups, #hidden, #hiddens, #hr, #hrs, #htmls, #i, #iframe, #iframes, #image, #images, #img, #imgs, #input, #inputs, #ins, #inses, #is, #kbd, #kbds, #keygen, #keygens, #label, #labels, #legend, #legends, #li, #link, #links, #lis, #main, #mains, #map, #maps, #mark, #marks, #menu, #menuitem, #menuitems, #menus, #meta, #metas, #meter, #meters, #nav, #navs, #noscript, #noscripts, #object, #objects, #ol, #ols, #optgroup, #optgroups, #option, #options, #output, #outputs, #p, #param, #params, #pre, #pres, #progress, #progresses, #ps, #q, #qs, #radio, #radios, #rp, #rps, #rt, #rts, #rubies, #ruby, #s, #samp, #samps, #script, #scripts, #section, #sections, #select, #select_list, #select_lists, #selects, #small, #smalls, #source, #sources, #span, #spans, #ss, #strong, #strongs, #style, #styles, #sub, #subs, #summaries, #summary, #sup, #sups, #table, #tables, #tbody, #tbodys, #td, #tds, #template, #templates, #text_field, #text_fields, #textarea, #textareas, #tfoot, #tfoots, #th, #thead, #theads, #ths, #time, #times, #title, #titles, #tr, #track, #tracks, #trs, #u, #ul, #uls, #us, #var, #vars, #video, #videos, #wbr, #wbrs

Methods included from Atoms

load

Methods included from XpathSupport

downcase, escape

Constructor Details

This class inherits a constructor from Watir::Element

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Watir::Element

Instance Method Details

#alignString

Returns value of align property.

Returns:

  • (String)

    value of align property



796
# File 'lib/watir-webdriver/elements/generated.rb', line 796

attribute(String, :align, :align)

#allow_fullscreen?Boolean

Returns value of allowFullscreen property.

Returns:

  • (Boolean)

    value of allowFullscreen property



791
# File 'lib/watir-webdriver/elements/generated.rb', line 791

attribute("Boolean", :allow_fullscreen?, :allowFullscreen)

#assert_existsObject



19
20
21
22
23
24
25
# File 'lib/watir-webdriver/elements/iframe.rb', line 19

def assert_exists
  if @selector.has_key? :element
    raise UnknownFrameException, "wrapping a WebDriver element as a Frame is not currently supported"
  end

  super
end

#content_documentString

Returns value of contentDocument property.

Returns:

  • (String)

    value of contentDocument property



794
# File 'lib/watir-webdriver/elements/generated.rb', line 794

attribute(String, :content_document, :contentDocument)

#content_windowString

Returns value of contentWindow property.

Returns:

  • (String)

    value of contentWindow property



795
# File 'lib/watir-webdriver/elements/generated.rb', line 795

attribute(String, :content_window, :contentWindow)

#execute_script(*args) ⇒ Object



35
36
37
# File 'lib/watir-webdriver/elements/iframe.rb', line 35

def execute_script(*args)
  browser.execute_script(*args)
end

#frame_borderString

Returns value of frameBorder property.

Returns:

  • (String)

    value of frameBorder property



798
# File 'lib/watir-webdriver/elements/generated.rb', line 798

attribute(String, :frame_border, :frameBorder)

#heightString

Returns value of height property.

Returns:

  • (String)

    value of height property



793
# File 'lib/watir-webdriver/elements/generated.rb', line 793

attribute(String, :height, :height)

#htmlObject



27
28
29
30
31
32
33
# File 'lib/watir-webdriver/elements/iframe.rb', line 27

def html
  assert_exists

  # this will actually give us the innerHTML instead of the outerHTML of the <frame>,
  # but given the choice this seems more useful
  element_call { execute_atom(:getOuterHtml, @element.find_element(:tag_name => "html")).strip }
end

#locateObject



5
6
7
8
9
10
11
12
13
# File 'lib/watir-webdriver/elements/iframe.rb', line 5

def locate
  @parent.assert_exists

  locator = locator_class.new(@parent.wd, @selector.merge(:tag_name => frame_tag), self.class.attribute_list)
  element = locator.locate
  element or raise UnknownFrameException, "unable to locate #{@selector[:tag_name]} using #{selector_string}"

  FramedDriver.new(element, driver)
end

#long_descString

Returns value of longDesc property.

Returns:

  • (String)

    value of longDesc property



799
# File 'lib/watir-webdriver/elements/generated.rb', line 799

attribute(String, :long_desc, :longDesc)

#margin_heightString

Returns value of marginHeight property.

Returns:

  • (String)

    value of marginHeight property



800
# File 'lib/watir-webdriver/elements/generated.rb', line 800

attribute(String, :margin_height, :marginHeight)

#margin_widthString

Returns value of marginWidth property.

Returns:

  • (String)

    value of marginWidth property



801
# File 'lib/watir-webdriver/elements/generated.rb', line 801

attribute(String, :margin_width, :marginWidth)

#nameString

Returns value of name property.

Returns:

  • (String)

    value of name property



788
# File 'lib/watir-webdriver/elements/generated.rb', line 788

attribute(String, :name, :name)

#sandboxString

Returns value of sandbox property.

Returns:

  • (String)

    value of sandbox property



789
# File 'lib/watir-webdriver/elements/generated.rb', line 789

attribute(String, :sandbox, :sandbox)

#scrollingString

Returns value of scrolling property.

Returns:

  • (String)

    value of scrolling property



797
# File 'lib/watir-webdriver/elements/generated.rb', line 797

attribute(String, :scrolling, :scrolling)

#seamless?Boolean

Returns value of seamless property.

Returns:

  • (Boolean)

    value of seamless property



790
# File 'lib/watir-webdriver/elements/generated.rb', line 790

attribute("Boolean", :seamless?, :seamless)

#srcString

Returns value of src property.

Returns:

  • (String)

    value of src property



786
# File 'lib/watir-webdriver/elements/generated.rb', line 786

attribute(String, :src, :src)

#srcdocString

Returns value of srcdoc property.

Returns:

  • (String)

    value of srcdoc property



787
# File 'lib/watir-webdriver/elements/generated.rb', line 787

attribute(String, :srcdoc, :srcdoc)

#switch_to!Object



15
16
17
# File 'lib/watir-webdriver/elements/iframe.rb', line 15

def switch_to!
  locate.send :switch!
end

#widthString

Returns value of width property.

Returns:

  • (String)

    value of width property



792
# File 'lib/watir-webdriver/elements/generated.rb', line 792

attribute(String, :width, :width)