Class: Watir::Image
- Inherits:
-
HTMLElement
- Object
- Element
- HTMLElement
- Watir::Image
- Defined in:
- lib/watir-webdriver/elements/image.rb,
lib/watir-webdriver/elements/html_elements.rb
Constant Summary
Constants included from Atoms
Instance Method Summary collapse
-
#align ⇒ String
Value of align property.
-
#alt ⇒ String
Value of alt property.
-
#border ⇒ String
Value of border property.
-
#complete? ⇒ Boolean
Value of complete property.
-
#cross_origin ⇒ String
Value of crossOrigin property.
-
#current_src ⇒ String
Value of currentSrc property.
- #file_created_date ⇒ Object
- #file_size ⇒ Object
-
#height ⇒ Fixnum
Value of height property.
-
#hspace ⇒ Fixnum
Value of hspace property.
-
#loaded? ⇒ Boolean
Returns true if image is loaded.
-
#long_desc ⇒ String
Value of longDesc property.
-
#lowsrc ⇒ String
Value of lowsrc property.
-
#map? ⇒ Boolean
Value of isMap property.
-
#name ⇒ String
Value of name property.
-
#natural_height ⇒ Fixnum
Value of naturalHeight property.
-
#natural_width ⇒ Fixnum
Value of naturalWidth property.
- #save(path) ⇒ Object
-
#sizes ⇒ String
Value of sizes property.
-
#src ⇒ String
Value of src property.
-
#srcset ⇒ String
Value of srcset property.
-
#use_map ⇒ String
Value of useMap property.
-
#vspace ⇒ Fixnum
Value of vspace property.
-
#width ⇒ Fixnum
Value of width property.
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, #enabled?, #exists?, #fire_event, #flash, #focus, #focused?, #hash, #hover, #id, #initialize, #inner_html, #inspect, #outer_html, #parent, #present?, #right_click, #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_enabled, #when_present
Methods included from Container
#a, #abbr, #abbrs, #address, #addresses, #animate, #animate_motion, #animate_motions, #animate_transform, #animate_transforms, #animates, #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, #circle, #circles, #cite, #cites, #code, #codes, #col, #colgroup, #colgroups, #cols, #cursor, #cursors, #data, #datalist, #datalists, #datas, #dd, #dds, #defs, #defss, #del, #dels, #desc, #descs, #details, #detailses, #dfn, #dfns, #dialog, #dialogs, #discard, #discards, #div, #divs, #dl, #dls, #dt, #dts, #element, #elements, #ellipse, #ellipses, #em, #embed, #embeds, #ems, #extract_selector, #field_set, #field_sets, #fieldset, #fieldsets, #figcaption, #figcaptions, #figure, #figures, #file_field, #file_fields, #font, #fonts, #footer, #footers, #foreign_object, #foreign_objects, #form, #forms, #frame, #frames, #frameset, #framesets, #g, #gs, #h1, #h1s, #h2, #h2s, #h3, #h3s, #h4, #h4s, #h5, #h5s, #h6, #h6s, #head, #header, #headers, #heads, #hgroup, #hgroups, #hidden, #hiddens, #hr, #hrs, #html, #htmls, #i, #iframe, #iframes, #image, #images, #img, #imgs, #input, #inputs, #ins, #inses, #is, #kbd, #kbds, #keygen, #keygens, #label, #labels, #legend, #legends, #li, #line, #linear_gradient, #linear_gradients, #lines, #link, #links, #lis, #main, #mains, #map, #maps, #mark, #marker, #markers, #marks, #menu, #menuitem, #menuitems, #menus, #mesh_gradient, #mesh_gradients, #mesh_patch, #mesh_patches, #mesh_row, #mesh_rows, #meta, #metadata, #metadatas, #metas, #meter, #meters, #mpath, #mpaths, #nav, #navs, #noscript, #noscripts, #object, #objects, #ol, #ols, #optgroup, #optgroups, #option, #options, #output, #outputs, #p, #param, #params, #path, #paths, #pattern, #patterns, #polygon, #polygons, #polyline, #polylines, #pre, #pres, #progress, #progresses, #ps, #q, #qs, #radial_gradient, #radial_gradients, #radio, #radios, #rect, #rects, #rp, #rps, #rt, #rts, #rubies, #ruby, #s, #samp, #samps, #script, #scripts, #section, #sections, #select, #select_list, #select_lists, #selects, #set, #sets, #small, #smalls, #source, #sources, #span, #spans, #ss, #stop, #stops, #strong, #strongs, #style, #styles, #sub, #subs, #summaries, #summary, #sup, #sups, #svg, #svgs, #switch, #switches, #symbol, #symbols, #table, #tables, #tbody, #tbodys, #td, #tds, #template, #templates, #text_field, #text_fields, #text_path, #text_paths, #textarea, #textareas, #tfoot, #tfoots, #th, #thead, #theads, #ths, #time, #times, #title, #titles, #tr, #track, #tracks, #trs, #tspan, #tspans, #u, #ul, #uls, #us, #use, #uses, #var, #vars, #video, #videos, #view, #views, #wbr, #wbrs
Methods included from Atoms
Methods included from XpathSupport
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
#align ⇒ String
Returns value of align property.
732 |
# File 'lib/watir-webdriver/elements/html_elements.rb', line 732 attribute(String, :align, :align) |
#alt ⇒ String
Returns value of alt property.
717 |
# File 'lib/watir-webdriver/elements/html_elements.rb', line 717 attribute(String, :alt, :alt) |
#border ⇒ String
Returns value of border property.
736 |
# File 'lib/watir-webdriver/elements/html_elements.rb', line 736 attribute(String, :border, :border) |
#complete? ⇒ Boolean
Returns value of complete property.
728 |
# File 'lib/watir-webdriver/elements/html_elements.rb', line 728 attribute("Boolean", :complete?, :complete) |
#cross_origin ⇒ String
Returns value of crossOrigin property.
721 |
# File 'lib/watir-webdriver/elements/html_elements.rb', line 721 attribute(String, :cross_origin, :crossOrigin) |
#current_src ⇒ String
Returns value of currentSrc property.
729 |
# File 'lib/watir-webdriver/elements/html_elements.rb', line 729 attribute(String, :current_src, :currentSrc) |
#file_created_date ⇒ Object
41 42 43 44 |
# File 'lib/watir-webdriver/elements/image.rb', line 41 def file_created_date assert_exists raise NotImplementedError, "not currently supported by WebDriver" end |
#file_size ⇒ Object
46 47 48 49 |
# File 'lib/watir-webdriver/elements/image.rb', line 46 def file_size assert_exists raise NotImplementedError, "not currently supported by WebDriver" end |
#height ⇒ Fixnum
Returns value of height property.
36 37 38 39 |
# File 'lib/watir-webdriver/elements/image.rb', line 36 def height assert_exists driver.execute_script "return arguments[0].height", @element end |
#hspace ⇒ Fixnum
Returns value of hspace property.
733 |
# File 'lib/watir-webdriver/elements/html_elements.rb', line 733 attribute(Fixnum, :hspace, :hspace) |
#loaded? ⇒ Boolean
Returns true if image is loaded.
10 11 12 13 14 15 16 17 |
# File 'lib/watir-webdriver/elements/image.rb', line 10 def loaded? return false unless complete? driver.execute_script( 'return typeof arguments[0].naturalWidth != "undefined" && arguments[0].naturalWidth > 0', @element ) end |
#long_desc ⇒ String
Returns value of longDesc property.
735 |
# File 'lib/watir-webdriver/elements/html_elements.rb', line 735 attribute(String, :long_desc, :longDesc) |
#lowsrc ⇒ String
Returns value of lowsrc property.
731 |
# File 'lib/watir-webdriver/elements/html_elements.rb', line 731 attribute(String, :lowsrc, :lowsrc) |
#map? ⇒ Boolean
Returns value of isMap property.
723 |
# File 'lib/watir-webdriver/elements/html_elements.rb', line 723 attribute("Boolean", :map?, :isMap) |
#name ⇒ String
Returns value of name property.
730 |
# File 'lib/watir-webdriver/elements/html_elements.rb', line 730 attribute(String, :name, :name) |
#natural_height ⇒ Fixnum
Returns value of naturalHeight property.
727 |
# File 'lib/watir-webdriver/elements/html_elements.rb', line 727 attribute(Fixnum, :natural_height, :naturalHeight) |
#natural_width ⇒ Fixnum
Returns value of naturalWidth property.
726 |
# File 'lib/watir-webdriver/elements/html_elements.rb', line 726 attribute(Fixnum, :natural_width, :naturalWidth) |
#save(path) ⇒ Object
51 52 53 54 |
# File 'lib/watir-webdriver/elements/image.rb', line 51 def save(path) assert_exists raise NotImplementedError, "not currently supported by WebDriver" end |
#sizes ⇒ String
Returns value of sizes property.
720 |
# File 'lib/watir-webdriver/elements/html_elements.rb', line 720 attribute(String, :sizes, :sizes) |
#src ⇒ String
Returns value of src property.
718 |
# File 'lib/watir-webdriver/elements/html_elements.rb', line 718 attribute(String, :src, :src) |
#srcset ⇒ String
Returns value of srcset property.
719 |
# File 'lib/watir-webdriver/elements/html_elements.rb', line 719 attribute(String, :srcset, :srcset) |
#use_map ⇒ String
Returns value of useMap property.
722 |
# File 'lib/watir-webdriver/elements/html_elements.rb', line 722 attribute(String, :use_map, :useMap) |
#vspace ⇒ Fixnum
Returns value of vspace property.
734 |
# File 'lib/watir-webdriver/elements/html_elements.rb', line 734 attribute(Fixnum, :vspace, :vspace) |
#width ⇒ Fixnum
Returns value of width property.
25 26 27 28 |
# File 'lib/watir-webdriver/elements/image.rb', line 25 def width assert_exists driver.execute_script "return arguments[0].width", @element end |