Class | Watir::IE |
In: | watir.rb |
Parent: | Object |
This class is the main Internet Explorer Controller An instance of this must be created to access Internet Explorer.
http://wtr.rubyforge.org/rdoc/classes/Watir/IE.html#M000293
Methods
Included Modules
Constants
REVISION | = | "$Revision: 1.211.2.2 $" | The revision number ( according to CVS ) | |
VERSION | = | "1.4.1" | the Release number | |
READYSTATE_COMPLETE | = | 4 | Used internally to determine when IE has finished loading a page | |
DEFAULT_TYPING_SPEED | = | 0.08 | The default delay when entering text on a web page. | |
DEFAULT_SLEEP_TIME | = | 0.1 | The default time we wait after a page has loaded. | |
DEFAULT_HIGHLIGHT_COLOR | = | "yellow" | The default color for highlighting objects as they are accessed. |
Attributes
activeObjectHighLightColor | [RW] | The color we want to use for the active object. This can be any valid web-friendly color. |
defaultSleepTime | [RW] | This is used to change how long after a page has finished loading that we wait for. |
down_load_time | [R] | use this to get the time for the last page download |
enable_spinner | [RW] | use this to switch the spinner on and off |
ie | [R] | Use this to gain access to the ‘raw’ internet explorer object. |
logger | [RW] | access to the logger object |
newWindow | [RW] | When a new window is created it is stored in newWindow |
typingspeed | [RW] | This is used to change the typing speed when entering text on a page. |
url_list | [R] | this contains the list of unique urls that have been visited |
Public Class methods
Attach to an existing IE window, either by url or title. IE.attach(:url, ‘www.google.com’) IE.attach(:title, ‘Google’)
Create a new IE Window, starting at the specified url. If no url is given, start empty.
Public Instance methods
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
This method checks the currently displayed page for http errors, 404, 500 etc It gets called internally by the wait method, so a user does not need to call it explicitly
Search the current page for specified text or regexp. Returns true if the specified text was found. Returns matchdata object if the specified regexp was found.
* text - string or regular expression - the string to look for
Go to the next page - the same as clicking the browsers forward button an WIN32OLERuntimeError exception is raised if the browser cant go forward
Deprecated: Use IE#ie instead This method returns the Internet Explorer object. Methods, properties, etc. that the IE object does not support can be accessed.
Refresh the current page - the same as clicking the browsers refresh button an WIN32OLERuntimeError exception is raised if the browser cant refresh
Send key events to IE window. See www.autoitscript.com/autoit3/docs/appendix/SendKeys.htm for complete documentation on keys supported and syntax.
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 the available objects on the current page. This is usually only used for debugging or writing new test scripts. This is a nice feature to help find out what HTML objects are on a page when developing a test case using Watir.
This method is used to display the available html frames that Internet Explorer currently has loaded. This method is usually only used for debugging test scripts.