Class Watir::IE
In: watir/contrib/ie-new-process.rb
watir/close_all.rb
watir/ie-process.rb
watir/ie.rb
watir/process.rb
Parent: Object

Methods

Included Modules

Watir::Exception Container PageContainer Watir::Win32 Watir::Utils

Classes and Modules

Class Watir::IE::Process

Constants

REVISION_STRING = '$Revision: 1263 $'   The revision number (according to Subversion)
REVISION = $1 or 'unknown'
VERSION_SHORT = '1.5.5'   The Release number
VERSION = VERSION_SHORT + '.' + REVISION
READYSTATE_COMPLETE = 4   Used internally to determine when IE has finished loading a page
HIGHLIGHT_COLOR = 'yellow'   The default color for highlighting objects as they are accessed.
EMPTY_TAG_NAME = "DUMMY"   IE inserts some element whose tagName is empty and just acts as block level element Probably some IE method of cleaning things To pass the same to REXML we need to give some name to empty tagName

Attributes

down_load_time  [R]  The time, in seconds, it took for the new page to load after executing the the last command
hwnd  [W] 
ie  [RW]  the OLE Internet Explorer object
logger  [RW]  access to the logger object
process_id  [W] 
speed  [R]  Whether the speed is :fast or :slow
url_list  [R]  this contains the list of unique urls that have been visited

Public Class methods

Return a Watir::IE object for an existing IE window. Window can be referenced by url, title, or window handle. Second argument can be either a string or a regular expression in the case of of :url or :title. IE.attach(:url, ‘www.google.com’) IE.attach(:title, ‘Google’) IE.attach(:hwnd, 528140) This method will not work when Watir/Ruby is run under a service (instead of a user).

Return an IE object that wraps the given window, typically obtained from Shell.Application.windows.

close all ie browser windows

Yields successively to each IE window on the current desktop. Takes a block. This method will not work when Watir/Ruby is run under a service (instead of a user). Yields to the window and its hwnd.

return internet explorer instance as specified. if none is found, return nil. arguments:

  :url, url -- the URL of the IE browser window
  :title, title -- the title of the browser page
  :hwnd, hwnd -- the window handle of the browser window.

This method will not work when Watir/Ruby is run under a service (instead of a user).

Create a new IE window in a new process. This method will not work when Watir/Ruby is run under a service (instead of a user).

Create a new IE window. Works just like IE.new in Watir 1.4.

Returns the number of IEXPLORE processes currently running.

Maximum number of seconds to wait when attaching to a window

Create a new IE Window, starting at the specified url. If no url is given, start empty.

Create a new IE window in a new process, starting at the specified URL. Same as IE.start.

Create a new IE window, starting at the specified url. If no url is given, start empty. Works like IE.start in Watir 1.4.

Public Instance methods

this method is used internally to attach to an existing window

this method is used to add an error checker that gets executed on every page load

  • checker Proc Object, that contains the code to be run

Go to the previous page - the same as clicking the browsers back button an WIN32OLERuntimeError exception is raised if the browser cant go back

Make the window come to the front

clear the list of urls that we have visited

Closes the Browser

close modal dialog. unlike IE#modal_dialog.close, does not wait for dialog to appear and does not raise exception if no window is found. returns true if modal was found and close, otherwise false

find other ie browser windows and close them

this allows a checker to be disabled

  • checker Proc Object, the checker that is to be disabled

Return the current document

return the first element that matches the xpath

execute xpath and return an array of elements

exist?()

Alias for exists?

Are we attached to an open browser?

Gives focus to the frame

Go to the next page - the same as clicking the browsers forward button an WIN32OLERuntimeError exception is raised if the browser cant go forward

Navigate to the specified URL.

 * url - string - the URL to navigate to

Return the current window handle

Maximize the window (expands to fill the screen)

Minimize the window (appears as icon on taskbar)

Refresh the current page - the same as clicking the browsers refresh button an WIN32OLERuntimeError exception is raised if the browser cant refresh

Restore the window (after minimizing or maximizing)

Get the Rexml object.

this method runs the predefined error checks

Send key events to IE window. See www.autoitscript.com/autoit3/docs/appendix/SendKeys.htm for complete documentation on keys supported and syntax.

deprecated: use speed = :fast instead

deprecated: use logger= instead

deprecated: use speed = :slow instead

this method shows the name, id etc of the object that is currently active - ie the element that has focus its mostly used in irb when creating a script

this method shows all the divs availble in the document

Show all forms displays all the forms that are on a web page.

this method shows all the images availble in the document

this method shows all the links availble in the document

this method shows all the spans availble in the document

this method is used to show all the tables that are available

Return the status of the window, typically from the status bar at the bottom.

Return the title of the document

returns the current url, as displayed in the address bar of the browser

Block execution until the page has loaded.

nodoc

Note: This code needs to be prepared for the ie object to be closed at any moment!

[Validate]