Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
kss.demo.selenium_utils.selenium.selenium Class Reference

List of all members.

Public Member Functions

def __init__
 This part is hard-coded in the XSL.
def start
def stop
def do_command
def get_string
def get_string_array
def get_number
def get_number_array
def get_boolean
def get_boolean_array
def click
 From here on, everything's auto-generated from XML.
def double_click
def click_at
def double_click_at
def fire_event
def key_press
def shift_key_down
def shift_key_up
def meta_key_down
def meta_key_up
def alt_key_down
def alt_key_up
def control_key_down
def control_key_up
def key_down
def key_up
def mouse_over
def mouse_out
def mouse_down
def mouse_down_at
def mouse_up
def mouse_up_at
def mouse_move
def mouse_move_at
def type
def set_speed
def get_speed
def check
def uncheck
def select
def add_selection
def remove_selection
def submit
def open
def open_window
def select_window
def select_frame
def get_log_messages
def get_whether_this_frame_match_frame_expression
def get_whether_this_window_match_window_expression
def wait_for_pop_up
def choose_cancel_on_next_confirmation
def answer_on_next_prompt
def go_back
def refresh
def close
def is_alert_present
def is_prompt_present
def is_confirmation_present
def get_alert
def get_confirmation
def get_prompt
def get_location
def get_title
def get_body_text
def get_value
def get_text
def get_eval
def is_checked
def get_table
def get_selected_labels
def get_selected_label
def get_selected_values
def get_selected_value
def get_selected_indexes
def get_selected_index
def get_selected_ids
def get_selected_id
def is_something_selected
def get_select_options
def get_attribute
def is_text_present
def is_element_present
def is_visible
def is_editable
def get_all_buttons
def get_all_links
def get_all_fields
def get_attribute_from_all_windows
def dragdrop
def drag_and_drop
def drag_and_drop_to_object
def window_focus
def window_maximize
def get_all_window_ids
def get_all_window_names
def get_all_window_titles
def get_html_source
def set_cursor_position
def get_element_index
def is_ordered
def get_element_position_left
def get_element_position_top
def get_element_width
def get_element_height
def get_cursor_position
def set_context
def get_expression
def wait_for_condition
def set_timeout
def wait_for_page_to_load
def get_cookie
def create_cookie
def delete_cookie

Public Attributes

 host
 port
 browserStartCommand
 browserURL
 sessionId

Detailed Description

Defines an object that runs Selenium commands.

Element Locators
~~~~~~~~~~~~~~~~
Element Locators tell Selenium which HTML element a command refers to.
The format of a locator is:
\ *locatorType*\ **=**\ \ *argument*
We support the following strategies for locating elements:

*    \ **identifier**\ =\ *id*
    Select the element with the specified @id attribute. If no match is
    found, select the first element whose @name attribute is \ *id*.
    (This is normally the default; see below.)
*    \ **id**\ =\ *id*
    Select the element with the specified @id attribute.
*    \ **name**\ =\ *name*
    Select the first element with the specified @name attribute.

    *    username
    *    name=username
    
    

    The name may optionally be followed by one or more \ *element-filters*, separated from the name by whitespace.  If the \ *filterType* is not specified, \ **value**\  is assumed.

    *    name=flavour value=chocolate
    
    
*    \ **dom**\ =\ *javascriptExpression*
    
        Find an element by evaluating the specified string.  This allows you to traverse the HTML Document Object
        Model using JavaScript.  Note that you must not return a value in this string; simply make it the last expression in the block.
        *    dom=document.forms['myForm'].myDropdown
        *    dom=document.images[56]
        *    dom=function foo() { return document.links[1]; }; foo();
        
        
    
*    \ **xpath**\ =\ *xpathExpression*
    Locate an element using an XPath expression.
    *    xpath=//img[@alt='The image alt text']
    *    xpath=//table[@id='table1']//tr[4]/td[2]
    
    
*    \ **link**\ =\ *textPattern*
    Select the link (anchor) element which contains text matching the
    specified \ *pattern*.
    *    link=The link text
    
    
*    \ **css**\ =\ *cssSelectorSyntax*
    Select the element using css selectors. Please refer to CSS2 selectors, CSS3 selectors for more information. You can also check the TestCssLocators test in the selenium test suite for an example of usage, which is included in the downloaded selenium core package.
    *    css=a[href="#id3"]
    *    css=span#firstChild + span
    
    

    Currently the css selector locator supports all css1, css2 and css3 selectors except namespace in css3, some pseudo classes(:nth-of-type, :nth-last-of-type, :first-of-type, :last-of-type, :only-of-type, :visited, :hover, :active, :focus, :indeterminate) and pseudo elements(::first-line, ::first-letter, ::selection, ::before, ::after). 


Without an explicit locator prefix, Selenium uses the following default
strategies:

*    \ **dom**\ , for locators starting with "document."
*    \ **xpath**\ , for locators starting with "//"
*    \ **identifier**\ , otherwise

Element Filters
~~~~~~~~~~~~~~~Element filters can be used with a locator to refine a list of candidate elements.  They are currently used only in the 'name' element-locator.
Filters look much like locators, ie.
\ *filterType*\ **=**\ \ *argument*Supported element-filters are:
\ **value=**\ \ *valuePattern*

Matches elements based on their values.  This is particularly useful for refining a list of similarly-named toggle-buttons.\ **index=**\ \ *index*

Selects a single element based on its position in the list (offset from zero).String-match Patterns
~~~~~~~~~~~~~~~~~~~~~
Various Pattern syntaxes are available for matching string values:

*    \ **glob:**\ \ *pattern*
    Match a string against a "glob" (aka "wildmat") pattern. "Glob" is a
    kind of limited regular-expression syntax typically used in command-line
    shells. In a glob pattern, "*" represents any sequence of characters, and "?"
    represents any single character. Glob patterns match against the entire
    string.
*    \ **regexp:**\ \ *regexp*
    Match a string using a regular-expression. The full power of JavaScript
    regular-expressions is available.
*    \ **exact:**\ \ *string*
    Match a string exactly, verbatim, without any of that fancy wildcard
    stuff.


If no pattern prefix is specified, Selenium assumes that it's a "glob"
pattern.

Definition at line 25 of file selenium.py.


Constructor & Destructor Documentation

def kss.demo.selenium_utils.selenium.selenium.__init__ (   self,
  host,
  port,
  browserStartCommand,
  browserURL 
)

This part is hard-coded in the XSL.

Definition at line 127 of file selenium.py.

00127 
00128     def __init__(self, host, port, browserStartCommand, browserURL):
00129         self.host = host
00130         self.port = port
00131         self.browserStartCommand = browserStartCommand
00132         self.browserURL = browserURL
00133         self.sessionId = None

Here is the caller graph for this function:


Member Function Documentation

def kss.demo.selenium_utils.selenium.selenium.add_selection (   self,
  locator,
  optionLocator 
)
Add a selection to the set of selected options in a multi-select element using an option locator.

@see #doSelect for details of option locators

'locator' is an element locator identifying a multi-select box
'optionLocator' is an option locator (a label by default)

Definition at line 549 of file selenium.py.

00549 
00550     def add_selection(self,locator,optionLocator):
00551         """
00552         Add a selection to the set of selected options in a multi-select element using an option locator.
00553         
00554         @see #doSelect for details of option locators
00555         
00556         'locator' is an element locator identifying a multi-select box
00557         'optionLocator' is an option locator (a label by default)
00558         """
00559         self.do_command("addSelection", [locator,optionLocator,])
00560 

Here is the call graph for this function:

Press the alt key and hold it down until doAltUp() is called or a new page is loaded.

Definition at line 320 of file selenium.py.

00320 
00321     def alt_key_down(self):
00322         """
00323         Press the alt key and hold it down until doAltUp() is called or a new page is loaded.
00324         
00325         """
00326         self.do_command("altKeyDown", [])
00327 

Here is the call graph for this function:

Release the alt key.

Definition at line 328 of file selenium.py.

00328 
00329     def alt_key_up(self):
00330         """
00331         Release the alt key.
00332         
00333         """
00334         self.do_command("altKeyUp", [])
00335 

Here is the call graph for this function:

Instructs Selenium to return the specified answer string in response to
the next JavaScript prompt [window.prompt()].

'answer' is the answer to give in response to the prompt pop-up

Definition at line 732 of file selenium.py.

00732 
00733     def answer_on_next_prompt(self,answer):
00734         """
00735         Instructs Selenium to return the specified answer string in response to
00736         the next JavaScript prompt [window.prompt()].
00737         
00738         'answer' is the answer to give in response to the prompt pop-up
00739         """
00740         self.do_command("answerOnNextPrompt", [answer,])
00741 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.check (   self,
  locator 
)
Check a toggle-button (checkbox/radio)

'locator' is an element locator

Definition at line 488 of file selenium.py.

00488 
00489     def check(self,locator):
00490         """
00491         Check a toggle-button (checkbox/radio)
00492         
00493         'locator' is an element locator
00494         """
00495         self.do_command("check", [locator,])
00496 

Here is the call graph for this function:

By default, Selenium's overridden window.confirm() function will
return true, as if the user had manually clicked OK.  After running
this command, the next call to confirm() will return false, as if
the user had clicked Cancel.

Definition at line 721 of file selenium.py.

00721 
00722     def choose_cancel_on_next_confirmation(self):
00723         """
00724         By default, Selenium's overridden window.confirm() function will
00725         return true, as if the user had manually clicked OK.  After running
00726         this command, the next call to confirm() will return false, as if
00727         the user had clicked Cancel.
00728         
00729         """
00730         self.do_command("chooseCancelOnNextConfirmation", [])
00731 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.click (   self,
  locator 
)

From here on, everything's auto-generated from XML.

Clicks on a link, button, checkbox or radio button. If the click action
causes a new page to load (like a link usually does), call
waitForPageToLoad.

'locator' is an element locator

Definition at line 221 of file selenium.py.

00221 
00222     def click(self,locator):
00223         """
00224         Clicks on a link, button, checkbox or radio button. If the click action
00225         causes a new page to load (like a link usually does), call
00226         waitForPageToLoad.
00227         
00228         'locator' is an element locator
00229         """
00230         self.do_command("click", [locator,])
00231 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.click_at (   self,
  locator,
  coordString 
)
Clicks on a link, button, checkbox or radio button. If the click action
causes a new page to load (like a link usually does), call
waitForPageToLoad.

'locator' is an element locator
'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse      event relative to the element returned by the locator.

Definition at line 243 of file selenium.py.

00243 
00244     def click_at(self,locator,coordString):
00245         """
00246         Clicks on a link, button, checkbox or radio button. If the click action
00247         causes a new page to load (like a link usually does), call
00248         waitForPageToLoad.
00249         
00250         'locator' is an element locator
00251         'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse      event relative to the element returned by the locator.
00252         """
00253         self.do_command("clickAt", [locator,coordString,])
00254 

Here is the call graph for this function:

Simulates the user clicking the "close" button in the titlebar of a popup
window or tab.

Definition at line 758 of file selenium.py.

00758 
00759     def close(self):
00760         """
00761         Simulates the user clicking the "close" button in the titlebar of a popup
00762         window or tab.
00763         
00764         """
00765         self.do_command("close", [])
00766 

Here is the call graph for this function:

Here is the caller graph for this function:

Press the control key and hold it down until doControlUp() is called or a new page is loaded.

Definition at line 336 of file selenium.py.

00336 
00337     def control_key_down(self):
00338         """
00339         Press the control key and hold it down until doControlUp() is called or a new page is loaded.
00340         
00341         """
00342         self.do_command("controlKeyDown", [])
00343 

Here is the call graph for this function:

Release the control key.

Definition at line 344 of file selenium.py.

00344 
00345     def control_key_up(self):
00346         """
00347         Release the control key.
00348         
00349         """
00350         self.do_command("controlKeyUp", [])
00351 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.create_cookie (   self,
  nameValuePair,
  optionsString 
)
Create a new cookie whose path and domain are same with those of current page
under test, unless you specified a path for this cookie explicitly.

'nameValuePair' is name and value of the cookie in a format "name=value"
'optionsString' is options for the cookie. Currently supported options include 'path' and 'max_age'.      the optionsString's format is "path=/path/, max_age=60". The order of options are irrelevant, the unit      of the value of 'max_age' is second.

Definition at line 1386 of file selenium.py.

01386 
01387     def create_cookie(self,nameValuePair,optionsString):
01388         """
01389         Create a new cookie whose path and domain are same with those of current page
01390         under test, unless you specified a path for this cookie explicitly.
01391         
01392         'nameValuePair' is name and value of the cookie in a format "name=value"
01393         'optionsString' is options for the cookie. Currently supported options include 'path' and 'max_age'.      the optionsString's format is "path=/path/, max_age=60". The order of options are irrelevant, the unit      of the value of 'max_age' is second.
01394         """
01395         self.do_command("createCookie", [nameValuePair,optionsString,])
01396 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.delete_cookie (   self,
  name,
  path 
)
Delete a named cookie with specified path.

'name' is the name of the cookie to be deleted
'path' is the path property of the cookie to be deleted

Definition at line 1397 of file selenium.py.

01397 
01398     def delete_cookie(self,name,path):
01399         """
01400         Delete a named cookie with specified path.
01401         
01402         'name' is the name of the cookie to be deleted
01403         'path' is the path property of the cookie to be deleted
01404         """
01405         self.do_command("deleteCookie", [name,path,])
01406 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.do_command (   self,
  verb,
  args 
)

Definition at line 145 of file selenium.py.

00145 
00146     def do_command(self, verb, args):
00147         conn = httplib.HTTPConnection(self.host, self.port)
00148         commandString = u'/selenium-server/driver/?cmd=' + urllib.quote_plus(unicode(verb).encode('utf-8'))
00149         for i in range(len(args)):
00150             commandString = commandString + '&' + unicode(i+1) + '=' + urllib.quote_plus(unicode(args[i]).encode('utf-8'))
00151         if (None != self.sessionId):
00152             commandString = commandString + "&sessionId=" + unicode(self.sessionId)
00153         conn.request("GET", commandString)
00154     
00155         response = conn.getresponse()
00156         #print response.status, response.reason
00157         data = unicode(response.read(), "UTF-8")
00158         result = response.reason
00159         #print "Selenium Result: " + repr(data) + "\n\n"
00160         if (not data.startswith('OK')):
00161             raise Exception, data
00162         return data
    

Here is the call graph for this function:

Double clicks on a link, button, checkbox or radio button. If the double click action
causes a new page to load (like a link usually does), call
waitForPageToLoad.

'locator' is an element locator

Definition at line 232 of file selenium.py.

00232 
00233     def double_click(self,locator):
00234         """
00235         Double clicks on a link, button, checkbox or radio button. If the double click action
00236         causes a new page to load (like a link usually does), call
00237         waitForPageToLoad.
00238         
00239         'locator' is an element locator
00240         """
00241         self.do_command("doubleClick", [locator,])
00242 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.double_click_at (   self,
  locator,
  coordString 
)
Doubleclicks on a link, button, checkbox or radio button. If the action
causes a new page to load (like a link usually does), call
waitForPageToLoad.

'locator' is an element locator
'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse      event relative to the element returned by the locator.

Definition at line 255 of file selenium.py.

00255 
00256     def double_click_at(self,locator,coordString):
00257         """
00258         Doubleclicks on a link, button, checkbox or radio button. If the action
00259         causes a new page to load (like a link usually does), call
00260         waitForPageToLoad.
00261         
00262         'locator' is an element locator
00263         'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse      event relative to the element returned by the locator.
00264         """
00265         self.do_command("doubleClickAt", [locator,coordString,])
00266 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.drag_and_drop (   self,
  locator,
  movementsString 
)
Drags an element a certain distance and then drops it

'locator' is an element locator
'movementsString' is offset in pixels from the current location to which the element should be moved, e.g., "+70,-300"

Definition at line 1147 of file selenium.py.

01147 
01148     def drag_and_drop(self,locator,movementsString):
01149         """
01150         Drags an element a certain distance and then drops it
01151         
01152         'locator' is an element locator
01153         'movementsString' is offset in pixels from the current location to which the element should be moved, e.g., "+70,-300"
01154         """
01155         self.do_command("dragAndDrop", [locator,movementsString,])
01156 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.drag_and_drop_to_object (   self,
  locatorOfObjectToBeDragged,
  locatorOfDragDestinationObject 
)
Drags an element and drops it on another element

'locatorOfObjectToBeDragged' is an element to be dragged
'locatorOfDragDestinationObject' is an element whose location (i.e., whose top left corner) will be the point where locatorOfObjectToBeDragged  is dropped

Definition at line 1157 of file selenium.py.

01157 
01158     def drag_and_drop_to_object(self,locatorOfObjectToBeDragged,locatorOfDragDestinationObject):
01159         """
01160         Drags an element and drops it on another element
01161         
01162         'locatorOfObjectToBeDragged' is an element to be dragged
01163         'locatorOfDragDestinationObject' is an element whose location (i.e., whose top left corner) will be the point where locatorOfObjectToBeDragged  is dropped
01164         """
01165         self.do_command("dragAndDropToObject", [locatorOfObjectToBeDragged,locatorOfDragDestinationObject,])
01166 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.dragdrop (   self,
  locator,
  movementsString 
)
deprecated - use dragAndDrop instead

'locator' is an element locator
'movementsString' is offset in pixels from the current location to which the element should be moved, e.g., "+70,-300"

Definition at line 1137 of file selenium.py.

01137 
01138     def dragdrop(self,locator,movementsString):
01139         """
01140         deprecated - use dragAndDrop instead
01141         
01142         'locator' is an element locator
01143         'movementsString' is offset in pixels from the current location to which the element should be moved, e.g., "+70,-300"
01144         """
01145         self.do_command("dragdrop", [locator,movementsString,])
01146 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.fire_event (   self,
  locator,
  eventName 
)
Explicitly simulate an event, to trigger the corresponding "on\ *event*"
handler.

'locator' is an element locator
'eventName' is the event name, e.g. "focus" or "blur"

Definition at line 267 of file selenium.py.

00267 
00268     def fire_event(self,locator,eventName):
00269         """
00270         Explicitly simulate an event, to trigger the corresponding "on\ *event*"
00271         handler.
00272         
00273         'locator' is an element locator
00274         'eventName' is the event name, e.g. "focus" or "blur"
00275         """
00276         self.do_command("fireEvent", [locator,eventName,])
00277 

Here is the call graph for this function:

Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no alerts.

Getting an alert has the same effect as manually clicking OK. If an
alert is generated but you do not get/verify it, the next Selenium action
will fail.
NOTE: under Selenium, JavaScript alerts will NOT pop up a visible alert
dialog.
NOTE: Selenium does NOT support JavaScript alerts that are generated in a
page's onload() event handler. In this case a visible dialog WILL be
generated and Selenium will hang until someone manually clicks OK.

Definition at line 806 of file selenium.py.

00806 
00807     def get_alert(self):
00808         """
00809         Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no alerts.
00810         
00811         Getting an alert has the same effect as manually clicking OK. If an
00812         alert is generated but you do not get/verify it, the next Selenium action
00813         will fail.
00814         NOTE: under Selenium, JavaScript alerts will NOT pop up a visible alert
00815         dialog.
00816         NOTE: Selenium does NOT support JavaScript alerts that are generated in a
00817         page's onload() event handler. In this case a visible dialog WILL be
00818         generated and Selenium will hang until someone manually clicks OK.
00819         
00820         
00821         """
00822         return self.get_string("getAlert", [])
00823 

Here is the call graph for this function:

Returns the IDs of all buttons on the page.

If a given button has no ID, it will appear as "" in this array.

Definition at line 1095 of file selenium.py.

01095 
01096     def get_all_buttons(self):
01097         """
01098         Returns the IDs of all buttons on the page.
01099         
01100         If a given button has no ID, it will appear as "" in this array.
01101         
01102         
01103         """
01104         return self.get_string_array("getAllButtons", [])
01105 

Here is the call graph for this function:

Returns the IDs of all input fields on the page.

If a given field has no ID, it will appear as "" in this array.

Definition at line 1117 of file selenium.py.

01117 
01118     def get_all_fields(self):
01119         """
01120         Returns the IDs of all input fields on the page.
01121         
01122         If a given field has no ID, it will appear as "" in this array.
01123         
01124         
01125         """
01126         return self.get_string_array("getAllFields", [])
01127 

Here is the call graph for this function:

Returns the IDs of all links on the page.

If a given link has no ID, it will appear as "" in this array.

Definition at line 1106 of file selenium.py.

01106 
01107     def get_all_links(self):
01108         """
01109         Returns the IDs of all links on the page.
01110         
01111         If a given link has no ID, it will appear as "" in this array.
01112         
01113         
01114         """
01115         return self.get_string_array("getAllLinks", [])
01116 

Here is the call graph for this function:

Returns the IDs of all windows that the browser knows about.

Definition at line 1185 of file selenium.py.

01185 
01186     def get_all_window_ids(self):
01187         """
01188         Returns the IDs of all windows that the browser knows about.
01189         
01190         """
01191         return self.get_string_array("getAllWindowIds", [])
01192 

Here is the call graph for this function:

Returns the names of all windows that the browser knows about.

Definition at line 1193 of file selenium.py.

01193 
01194     def get_all_window_names(self):
01195         """
01196         Returns the names of all windows that the browser knows about.
01197         
01198         """
01199         return self.get_string_array("getAllWindowNames", [])
01200 

Here is the call graph for this function:

Returns the titles of all windows that the browser knows about.

Definition at line 1201 of file selenium.py.

01201 
01202     def get_all_window_titles(self):
01203         """
01204         Returns the titles of all windows that the browser knows about.
01205         
01206         """
01207         return self.get_string_array("getAllWindowTitles", [])
01208 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.get_attribute (   self,
  attributeLocator 
)
Gets the value of an element attribute.

'attributeLocator' is an element locator followed by an

Definition at line 1045 of file selenium.py.

01045 
01046     def get_attribute(self,attributeLocator):
01047         """
01048         Gets the value of an element attribute.
01049         
01050         'attributeLocator' is an element locator followed by an
01051         """
01052         return self.get_string("getAttribute", [attributeLocator,])
01053 

Here is the call graph for this function:

Returns every instance of some attribute from all known windows.

'attributeName' is name of an attribute on the windows

Definition at line 1128 of file selenium.py.

01128 
01129     def get_attribute_from_all_windows(self,attributeName):
01130         """
01131         Returns every instance of some attribute from all known windows.
01132         
01133         'attributeName' is name of an attribute on the windows
01134         """
01135         return self.get_string_array("getAttributeFromAllWindows", [attributeName,])
01136 

Here is the call graph for this function:

Gets the entire text of the page.

Definition at line 886 of file selenium.py.

00886 
00887     def get_body_text(self):
00888         """
00889         Gets the entire text of the page.
00890         
00891         """
00892         return self.get_string("getBodyText", [])
00893 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.get_boolean (   self,
  verb,
  args 
)

Definition at line 196 of file selenium.py.

00196 
00197     def get_boolean(self, verb, args):
00198         boolstr = self.get_string(verb, args)
00199         if ("true" == boolstr):
00200             return True
00201         if ("false" == boolstr):
00202             return False
00203         raise ValueError, "result is neither 'true' nor 'false': " + boolstr
    

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 204 of file selenium.py.

00204 
00205     def get_boolean_array(self, verb, args):
00206         boolarr = self.get_string_array(verb, args)
00207         for i in range(len(boolarr)):
00208             if ("true" == boolstr):
00209                 boolarr[i] = True
00210                 continue
00211             if ("false" == boolstr):
00212                 boolarr[i] = False
00213                 continue
00214             raise ValueError, "result is neither 'true' nor 'false': " + boolarr[i]
00215         return boolarr
00216     
00217     

Here is the call graph for this function:

Retrieves the message of a JavaScript confirmation dialog generated during
the previous action.


By default, the confirm function will return true, having the same effect
as manually clicking OK. This can be changed by prior execution of the
chooseCancelOnNextConfirmation command. If an confirmation is generated
but you do not get/verify it, the next Selenium action will fail.


NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible
dialog.


NOTE: Selenium does NOT support JavaScript confirmations that are
generated in a page's onload() event handler. In this case a visible
dialog WILL be generated and Selenium will hang until you manually click
OK.

Definition at line 824 of file selenium.py.

00824 
00825     def get_confirmation(self):
00826         """
00827         Retrieves the message of a JavaScript confirmation dialog generated during
00828         the previous action.
00829         
00830         
00831         By default, the confirm function will return true, having the same effect
00832         as manually clicking OK. This can be changed by prior execution of the
00833         chooseCancelOnNextConfirmation command. If an confirmation is generated
00834         but you do not get/verify it, the next Selenium action will fail.
00835         
00836         
00837         NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible
00838         dialog.
00839         
00840         
00841         NOTE: Selenium does NOT support JavaScript confirmations that are
00842         generated in a page's onload() event handler. In this case a visible
00843         dialog WILL be generated and Selenium will hang until you manually click
00844         OK.
00845         
00846         
00847         
00848         """
00849         return self.get_string("getConfirmation", [])
00850 

Here is the call graph for this function:

Return all cookies of the current page under test.

Definition at line 1378 of file selenium.py.

01378 
01379     def get_cookie(self):
01380         """
01381         Return all cookies of the current page under test.
01382         
01383         """
01384         return self.get_string("getCookie", [])
01385 

Here is the call graph for this function:

Retrieves the text cursor position in the given input element or textarea; beware, this may not work perfectly on all browsers.

Specifically, if the cursor/selection has been cleared by JavaScript, this command will tend to
return the position of the last location of the cursor, even though the cursor is now gone from the page.  This is filed as SEL-243.

This method will fail if the specified element isn't an input element or textarea, or there is no cursor in the element.

'locator' is an element locator pointing to an input element or textarea

Definition at line 1286 of file selenium.py.

01286 
01287     def get_cursor_position(self,locator):
01288         """
01289         Retrieves the text cursor position in the given input element or textarea; beware, this may not work perfectly on all browsers.
01290         
01291         Specifically, if the cursor/selection has been cleared by JavaScript, this command will tend to
01292         return the position of the last location of the cursor, even though the cursor is now gone from the page.  This is filed as SEL-243.
01293         
01294         This method will fail if the specified element isn't an input element or textarea, or there is no cursor in the element.
01295         
01296         'locator' is an element locator pointing to an input element or textarea
01297         """
01298         return self.get_number("getCursorPosition", [locator,])
01299 

Here is the call graph for this function:

Retrieves the height of an element

'locator' is an element locator pointing to an element

Definition at line 1277 of file selenium.py.

01277 
01278     def get_element_height(self,locator):
01279         """
01280         Retrieves the height of an element
01281         
01282         'locator' is an element locator pointing to an element
01283         """
01284         return self.get_number("getElementHeight", [locator,])
01285 

Here is the call graph for this function:

Get the relative index of an element to its parent (starting from 0). The comment node and empty text node
will be ignored.

'locator' is an element locator pointing to an element

Definition at line 1229 of file selenium.py.

01229 
01230     def get_element_index(self,locator):
01231         """
01232         Get the relative index of an element to its parent (starting from 0). The comment node and empty text node
01233         will be ignored.
01234         
01235         'locator' is an element locator pointing to an element
01236         """
01237         return self.get_number("getElementIndex", [locator,])
01238 

Here is the call graph for this function:

Retrieves the horizontal position of an element

'locator' is an element locator pointing to an element OR an element itself

Definition at line 1250 of file selenium.py.

01250 
01251     def get_element_position_left(self,locator):
01252         """
01253         Retrieves the horizontal position of an element
01254         
01255         'locator' is an element locator pointing to an element OR an element itself
01256         """
01257         return self.get_number("getElementPositionLeft", [locator,])
01258 

Here is the call graph for this function:

Retrieves the vertical position of an element

'locator' is an element locator pointing to an element OR an element itself

Definition at line 1259 of file selenium.py.

01259 
01260     def get_element_position_top(self,locator):
01261         """
01262         Retrieves the vertical position of an element
01263         
01264         'locator' is an element locator pointing to an element OR an element itself
01265         """
01266         return self.get_number("getElementPositionTop", [locator,])
01267 

Here is the call graph for this function:

Retrieves the width of an element

'locator' is an element locator pointing to an element

Definition at line 1268 of file selenium.py.

01268 
01269     def get_element_width(self,locator):
01270         """
01271         Retrieves the width of an element
01272         
01273         'locator' is an element locator pointing to an element
01274         """
01275         return self.get_number("getElementWidth", [locator,])
01276 

Here is the call graph for this function:

Gets the result of evaluating the specified JavaScript snippet.  The snippet may
have multiple lines, but only the result of the last line will be returned.

Note that, by default, the snippet will run in the context of the "selenium"
object itself, so ``this`` will refer to the Selenium object, and ``window`` will
refer to the top-level runner test window, not the window of your application.
If you need a reference to the window of your application, you can refer
to ``this.browserbot.getCurrentWindow()`` and if you need to use
a locator to refer to a single element in your application page, you can
use ``this.page().findElement("foo")`` where "foo" is your locator.


'script' is the JavaScript snippet to run

Definition at line 917 of file selenium.py.

00917 
00918     def get_eval(self,script):
00919         """
00920         Gets the result of evaluating the specified JavaScript snippet.  The snippet may
00921         have multiple lines, but only the result of the last line will be returned.
00922         
00923         Note that, by default, the snippet will run in the context of the "selenium"
00924         object itself, so ``this`` will refer to the Selenium object, and ``window`` will
00925         refer to the top-level runner test window, not the window of your application.
00926         If you need a reference to the window of your application, you can refer
00927         to ``this.browserbot.getCurrentWindow()`` and if you need to use
00928         a locator to refer to a single element in your application page, you can
00929         use ``this.page().findElement("foo")`` where "foo" is your locator.
00930         
00931         
00932         'script' is the JavaScript snippet to run
00933         """
00934         return self.get_string("getEval", [script,])
00935 

Here is the call graph for this function:

Returns the specified expression.

This is useful because of JavaScript preprocessing.
It is used to generate commands like assertExpression and waitForExpression.


'expression' is the value to return

Definition at line 1317 of file selenium.py.

01317 
01318     def get_expression(self,expression):
01319         """
01320         Returns the specified expression.
01321         
01322         This is useful because of JavaScript preprocessing.
01323         It is used to generate commands like assertExpression and waitForExpression.
01324         
01325         
01326         'expression' is the value to return
01327         """
01328         return self.get_string("getExpression", [expression,])
01329 

Here is the call graph for this function:

Returns the entire HTML source between the opening and
closing "html" tags.

Definition at line 1209 of file selenium.py.

01209 
01210     def get_html_source(self):
01211         """
01212         Returns the entire HTML source between the opening and
01213         closing "html" tags.
01214         
01215         """
01216         return self.get_string("getHtmlSource", [])
01217 

Here is the call graph for this function:

Gets the absolute URL of the current page.

Definition at line 870 of file selenium.py.

00870 
00871     def get_location(self):
00872         """
00873         Gets the absolute URL of the current page.
00874         
00875         """
00876         return self.get_string("getLocation", [])
00877 

Here is the call graph for this function:

Return the contents of the log.

This is a placeholder intended to make the code generator make this API
available to clients.  The selenium server will intercept this call, however,
and return its recordkeeping of log messages since the last call to this API.
Thus this code in JavaScript will never be called.
The reason I opted for a servercentric solution is to be able to support
multiple frames served from different domains, which would break a
centralized JavaScript logging mechanism under some conditions.

Definition at line 660 of file selenium.py.

00660 
00661     def get_log_messages(self):
00662         """
00663         Return the contents of the log.
00664         
00665         This is a placeholder intended to make the code generator make this API
00666         available to clients.  The selenium server will intercept this call, however,
00667         and return its recordkeeping of log messages since the last call to this API.
00668         Thus this code in JavaScript will never be called.
00669         The reason I opted for a servercentric solution is to be able to support
00670         multiple frames served from different domains, which would break a
00671         centralized JavaScript logging mechanism under some conditions.
00672         
00673         
00674         """
00675         return self.get_string("getLogMessages", [])
00676 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.get_number (   self,
  verb,
  args 
)

Definition at line 188 of file selenium.py.

00188 
00189     def get_number(self, verb, args):
00190         # Is there something I need to do here?
00191         return self.get_string(verb, args)
    

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 192 of file selenium.py.

00192 
00193     def get_number_array(self, verb, args):
00194         # Is there something I need to do here?
00195         return self.get_string_array(verb, args)

Here is the call graph for this function:

Retrieves the message of a JavaScript question prompt dialog generated during
the previous action.

Successful handling of the prompt requires prior execution of the
answerOnNextPrompt command. If a prompt is generated but you
do not get/verify it, the next Selenium action will fail.
NOTE: under Selenium, JavaScript prompts will NOT pop up a visible
dialog.
NOTE: Selenium does NOT support JavaScript prompts that are generated in a
page's onload() event handler. In this case a visible dialog WILL be
generated and Selenium will hang until someone manually clicks OK.

Definition at line 851 of file selenium.py.

00851 
00852     def get_prompt(self):
00853         """
00854         Retrieves the message of a JavaScript question prompt dialog generated during
00855         the previous action.
00856         
00857         Successful handling of the prompt requires prior execution of the
00858         answerOnNextPrompt command. If a prompt is generated but you
00859         do not get/verify it, the next Selenium action will fail.
00860         NOTE: under Selenium, JavaScript prompts will NOT pop up a visible
00861         dialog.
00862         NOTE: Selenium does NOT support JavaScript prompts that are generated in a
00863         page's onload() event handler. In this case a visible dialog WILL be
00864         generated and Selenium will hang until someone manually clicks OK.
00865         
00866         
00867         """
00868         return self.get_string("getPrompt", [])
00869 

Here is the call graph for this function:

Gets all option labels in the specified select drop-down.

'selectLocator' is an element locator identifying a drop-down menu

Definition at line 1036 of file selenium.py.

01036 
01037     def get_select_options(self,selectLocator):
01038         """
01039         Gets all option labels in the specified select drop-down.
01040         
01041         'selectLocator' is an element locator identifying a drop-down menu
01042         """
01043         return self.get_string_array("getSelectOptions", [selectLocator,])
01044 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.get_selected_id (   self,
  selectLocator 
)
Gets option element ID for selected option in the specified select element.

'selectLocator' is an element locator identifying a drop-down menu

Definition at line 1018 of file selenium.py.

01018 
01019     def get_selected_id(self,selectLocator):
01020         """
01021         Gets option element ID for selected option in the specified select element.
01022         
01023         'selectLocator' is an element locator identifying a drop-down menu
01024         """
01025         return self.get_string("getSelectedId", [selectLocator,])
01026 

Here is the call graph for this function:

Gets all option element IDs for selected options in the specified select or multi-select element.

'selectLocator' is an element locator identifying a drop-down menu

Definition at line 1009 of file selenium.py.

01009 
01010     def get_selected_ids(self,selectLocator):
01011         """
01012         Gets all option element IDs for selected options in the specified select or multi-select element.
01013         
01014         'selectLocator' is an element locator identifying a drop-down menu
01015         """
01016         return self.get_string_array("getSelectedIds", [selectLocator,])
01017 

Here is the call graph for this function:

Gets option index (option number, starting at 0) for selected option in the specified select element.

'selectLocator' is an element locator identifying a drop-down menu

Definition at line 1000 of file selenium.py.

01000 
01001     def get_selected_index(self,selectLocator):
01002         """
01003         Gets option index (option number, starting at 0) for selected option in the specified select element.
01004         
01005         'selectLocator' is an element locator identifying a drop-down menu
01006         """
01007         return self.get_string("getSelectedIndex", [selectLocator,])
01008 

Here is the call graph for this function:

Gets all option indexes (option number, starting at 0) for selected options in the specified select or multi-select element.

'selectLocator' is an element locator identifying a drop-down menu

Definition at line 991 of file selenium.py.

00991 
00992     def get_selected_indexes(self,selectLocator):
00993         """
00994         Gets all option indexes (option number, starting at 0) for selected options in the specified select or multi-select element.
00995         
00996         'selectLocator' is an element locator identifying a drop-down menu
00997         """
00998         return self.get_string_array("getSelectedIndexes", [selectLocator,])
00999 

Here is the call graph for this function:

Gets option label (visible text) for selected option in the specified select element.

'selectLocator' is an element locator identifying a drop-down menu

Definition at line 964 of file selenium.py.

00964 
00965     def get_selected_label(self,selectLocator):
00966         """
00967         Gets option label (visible text) for selected option in the specified select element.
00968         
00969         'selectLocator' is an element locator identifying a drop-down menu
00970         """
00971         return self.get_string("getSelectedLabel", [selectLocator,])
00972 

Here is the call graph for this function:

Gets all option labels (visible text) for selected options in the specified select or multi-select element.

'selectLocator' is an element locator identifying a drop-down menu

Definition at line 955 of file selenium.py.

00955 
00956     def get_selected_labels(self,selectLocator):
00957         """
00958         Gets all option labels (visible text) for selected options in the specified select or multi-select element.
00959         
00960         'selectLocator' is an element locator identifying a drop-down menu
00961         """
00962         return self.get_string_array("getSelectedLabels", [selectLocator,])
00963 

Here is the call graph for this function:

Gets option value (value attribute) for selected option in the specified select element.

'selectLocator' is an element locator identifying a drop-down menu

Definition at line 982 of file selenium.py.

00982 
00983     def get_selected_value(self,selectLocator):
00984         """
00985         Gets option value (value attribute) for selected option in the specified select element.
00986         
00987         'selectLocator' is an element locator identifying a drop-down menu
00988         """
00989         return self.get_string("getSelectedValue", [selectLocator,])
00990 

Here is the call graph for this function:

Gets all option values (value attributes) for selected options in the specified select or multi-select element.

'selectLocator' is an element locator identifying a drop-down menu

Definition at line 973 of file selenium.py.

00973 
00974     def get_selected_values(self,selectLocator):
00975         """
00976         Gets all option values (value attributes) for selected options in the specified select or multi-select element.
00977         
00978         'selectLocator' is an element locator identifying a drop-down menu
00979         """
00980         return self.get_string_array("getSelectedValues", [selectLocator,])
00981 

Here is the call graph for this function:

Get execution speed (i.e., get the millisecond length of the delay following each selenium operation).  By default, there is no such delay, i.e.,
the delay is 0 milliseconds.

See also setSpeed.

Definition at line 477 of file selenium.py.

00477 
00478     def get_speed(self):
00479         """
00480         Get execution speed (i.e., get the millisecond length of the delay following each selenium operation).  By default, there is no such delay, i.e.,
00481         the delay is 0 milliseconds.
00482         
00483         See also setSpeed.
00484         
00485         """
00486         self.do_command("getSpeed", [])
00487 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.get_string (   self,
  verb,
  args 
)

Definition at line 163 of file selenium.py.

00163 
00164     def get_string(self, verb, args):
00165         result = self.do_command(verb, args)
00166         return result[3:]
    

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 167 of file selenium.py.

00167 
00168     def get_string_array(self, verb, args):
00169         csv = self.get_string(verb, args)
00170         token = ""
00171         tokens = []
00172         escape = False
00173         for i in range(len(csv)):
00174             letter = csv[i]
00175             if (escape):
00176                 token = token + letter
00177                 escape = False
00178                 continue
00179             if (letter == '\\'):
00180                 escape = True
00181             elif (letter == ','):
00182                 tokens.append(token)
00183                 token = ""
00184             else:
00185                 token = token + letter
00186         tokens.append(token)
00187         return tokens

Here is the call graph for this function:

Here is the caller graph for this function:

def kss.demo.selenium_utils.selenium.selenium.get_table (   self,
  tableCellAddress 
)
Gets the text from a cell of a table. The cellAddress syntax
tableLocator.row.column, where row and column start at 0.

'tableCellAddress' is a cell address, e.g. "foo.1.4"

Definition at line 945 of file selenium.py.

00945 
00946     def get_table(self,tableCellAddress):
00947         """
00948         Gets the text from a cell of a table. The cellAddress syntax
00949         tableLocator.row.column, where row and column start at 0.
00950         
00951         'tableCellAddress' is a cell address, e.g. "foo.1.4"
00952         """
00953         return self.get_string("getTable", [tableCellAddress,])
00954 

Here is the call graph for this function:

Gets the text of an element. This works for any element that contains
text. This command uses either the textContent (Mozilla-like browsers) or
the innerText (IE-like browsers) of the element, which is the rendered
text shown to the user.

'locator' is an element locator

Definition at line 905 of file selenium.py.

00905 
00906     def get_text(self,locator):
00907         """
00908         Gets the text of an element. This works for any element that contains
00909         text. This command uses either the textContent (Mozilla-like browsers) or
00910         the innerText (IE-like browsers) of the element, which is the rendered
00911         text shown to the user.
00912         
00913         'locator' is an element locator
00914         """
00915         return self.get_string("getText", [locator,])
00916 

Here is the call graph for this function:

Gets the title of the current page.

Definition at line 878 of file selenium.py.

00878 
00879     def get_title(self):
00880         """
00881         Gets the title of the current page.
00882         
00883         """
00884         return self.get_string("getTitle", [])
00885 

Here is the call graph for this function:

Gets the (whitespace-trimmed) value of an input field (or anything else with a value parameter).
For checkbox/radio elements, the value will be "on" or "off" depending on
whether the element is checked or not.

'locator' is an element locator

Definition at line 894 of file selenium.py.

00894 
00895     def get_value(self,locator):
00896         """
00897         Gets the (whitespace-trimmed) value of an input field (or anything else with a value parameter).
00898         For checkbox/radio elements, the value will be "on" or "off" depending on
00899         whether the element is checked or not.
00900         
00901         'locator' is an element locator
00902         """
00903         return self.get_string("getValue", [locator,])
00904 

Here is the call graph for this function:

Determine whether current/locator identify the frame containing this running code.

This is useful in proxy injection mode, where this code runs in every
browser frame and window, and sometimes the selenium server needs to identify
the "current" frame.  In this case, when the test calls selectFrame, this
routine is called for each frame to figure out which one has been selected.
The selected frame will return true, while all others will return false.


'currentFrameString' is starting frame
'target' is new frame (which might be relative to the current one)

Definition at line 677 of file selenium.py.

00677 
00678     def get_whether_this_frame_match_frame_expression(self,currentFrameString,target):
00679         """
00680         Determine whether current/locator identify the frame containing this running code.
00681         
00682         This is useful in proxy injection mode, where this code runs in every
00683         browser frame and window, and sometimes the selenium server needs to identify
00684         the "current" frame.  In this case, when the test calls selectFrame, this
00685         routine is called for each frame to figure out which one has been selected.
00686         The selected frame will return true, while all others will return false.
00687         
00688         
00689         'currentFrameString' is starting frame
00690         'target' is new frame (which might be relative to the current one)
00691         """
00692         return self.get_boolean("getWhetherThisFrameMatchFrameExpression", [currentFrameString,target,])
00693 

Here is the call graph for this function:

Determine whether currentWindowString plus target identify the window containing this running code.

This is useful in proxy injection mode, where this code runs in every
browser frame and window, and sometimes the selenium server needs to identify
the "current" window.  In this case, when the test calls selectWindow, this
routine is called for each window to figure out which one has been selected.
The selected window will return true, while all others will return false.


'currentWindowString' is starting window
'target' is new window (which might be relative to the current one, e.g., "_parent")

Definition at line 694 of file selenium.py.

00694 
00695     def get_whether_this_window_match_window_expression(self,currentWindowString,target):
00696         """
00697         Determine whether currentWindowString plus target identify the window containing this running code.
00698         
00699         This is useful in proxy injection mode, where this code runs in every
00700         browser frame and window, and sometimes the selenium server needs to identify
00701         the "current" window.  In this case, when the test calls selectWindow, this
00702         routine is called for each window to figure out which one has been selected.
00703         The selected window will return true, while all others will return false.
00704         
00705         
00706         'currentWindowString' is starting window
00707         'target' is new window (which might be relative to the current one, e.g., "_parent")
00708         """
00709         return self.get_boolean("getWhetherThisWindowMatchWindowExpression", [currentWindowString,target,])
00710 

Here is the call graph for this function:

Simulates the user clicking the "back" button on their browser.

Definition at line 742 of file selenium.py.

00742 
00743     def go_back(self):
00744         """
00745         Simulates the user clicking the "back" button on their browser.
00746         
00747         """
00748         self.do_command("goBack", [])
00749 

Here is the call graph for this function:

Has an alert occurred?


This function never throws an exception

Definition at line 767 of file selenium.py.

00767 
00768     def is_alert_present(self):
00769         """
00770         Has an alert occurred?
00771         
00772         
00773         This function never throws an exception
00774         
00775         
00776         
00777         """
00778         return self.get_boolean("isAlertPresent", [])
00779 

Here is the call graph for this function:

Gets whether a toggle-button (checkbox/radio) is checked.  Fails if the specified element doesn't exist or isn't a toggle-button.

'locator' is an element locator pointing to a checkbox or radio button

Definition at line 936 of file selenium.py.

00936 
00937     def is_checked(self,locator):
00938         """
00939         Gets whether a toggle-button (checkbox/radio) is checked.  Fails if the specified element doesn't exist or isn't a toggle-button.
00940         
00941         'locator' is an element locator pointing to a checkbox or radio button
00942         """
00943         return self.get_boolean("isChecked", [locator,])
00944 

Here is the call graph for this function:

Has confirm() been called?


This function never throws an exception

Definition at line 793 of file selenium.py.

00793 
00794     def is_confirmation_present(self):
00795         """
00796         Has confirm() been called?
00797         
00798         
00799         This function never throws an exception
00800         
00801         
00802         
00803         """
00804         return self.get_boolean("isConfirmationPresent", [])
00805 

Here is the call graph for this function:

Determines whether the specified input element is editable, ie hasn't been disabled.
This method will fail if the specified element isn't an input element.

'locator' is an element locator

Definition at line 1085 of file selenium.py.

01085 
01086     def is_editable(self,locator):
01087         """
01088         Determines whether the specified input element is editable, ie hasn't been disabled.
01089         This method will fail if the specified element isn't an input element.
01090         
01091         'locator' is an element locator
01092         """
01093         return self.get_boolean("isEditable", [locator,])
01094 

Here is the call graph for this function:

Verifies that the specified element is somewhere on the page.

'locator' is an element locator

Definition at line 1063 of file selenium.py.

01063 
01064     def is_element_present(self,locator):
01065         """
01066         Verifies that the specified element is somewhere on the page.
01067         
01068         'locator' is an element locator
01069         """
01070         return self.get_boolean("isElementPresent", [locator,])
01071 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.is_ordered (   self,
  locator1,
  locator2 
)
Check if these two elements have same parent and are ordered. Two same elements will
not be considered ordered.

'locator1' is an element locator pointing to the first element
'locator2' is an element locator pointing to the second element

Definition at line 1239 of file selenium.py.

01239 
01240     def is_ordered(self,locator1,locator2):
01241         """
01242         Check if these two elements have same parent and are ordered. Two same elements will
01243         not be considered ordered.
01244         
01245         'locator1' is an element locator pointing to the first element
01246         'locator2' is an element locator pointing to the second element
01247         """
01248         return self.get_boolean("isOrdered", [locator1,locator2,])
01249 

Here is the call graph for this function:

Has a prompt occurred?


This function never throws an exception

Definition at line 780 of file selenium.py.

00780 
00781     def is_prompt_present(self):
00782         """
00783         Has a prompt occurred?
00784         
00785         
00786         This function never throws an exception
00787         
00788         
00789         
00790         """
00791         return self.get_boolean("isPromptPresent", [])
00792 

Here is the call graph for this function:

Determines whether some option in a drop-down menu is selected.

'selectLocator' is an element locator identifying a drop-down menu

Definition at line 1027 of file selenium.py.

01027 
01028     def is_something_selected(self,selectLocator):
01029         """
01030         Determines whether some option in a drop-down menu is selected.
01031         
01032         'selectLocator' is an element locator identifying a drop-down menu
01033         """
01034         return self.get_boolean("isSomethingSelected", [selectLocator,])
01035 

Here is the call graph for this function:

Verifies that the specified text pattern appears somewhere on the rendered page shown to the user.

'pattern' is a pattern to match with the text of the page

Definition at line 1054 of file selenium.py.

01054 
01055     def is_text_present(self,pattern):
01056         """
01057         Verifies that the specified text pattern appears somewhere on the rendered page shown to the user.
01058         
01059         'pattern' is a pattern to match with the text of the page
01060         """
01061         return self.get_boolean("isTextPresent", [pattern,])
01062 

Here is the call graph for this function:

Determines if the specified element is visible. An
element can be rendered invisible by setting the CSS "visibility"
property to "hidden", or the "display" property to "none", either for the
element itself or one if its ancestors.  This method will fail if
the element is not present.

'locator' is an element locator

Definition at line 1072 of file selenium.py.

01072 
01073     def is_visible(self,locator):
01074         """
01075         Determines if the specified element is visible. An
01076         element can be rendered invisible by setting the CSS "visibility"
01077         property to "hidden", or the "display" property to "none", either for the
01078         element itself or one if its ancestors.  This method will fail if
01079         the element is not present.
01080         
01081         'locator' is an element locator
01082         """
01083         return self.get_boolean("isVisible", [locator,])
01084 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.key_down (   self,
  locator,
  keySequence 
)
Simulates a user pressing a key (without releasing it yet).

'locator' is an element locator
'keySequence' is Either be a string("\" followed by the numeric keycode  of the key to be pressed, normally the ASCII value of that key), or a single  character. For example: "w", "\119".

Definition at line 352 of file selenium.py.

00352 
00353     def key_down(self,locator,keySequence):
00354         """
00355         Simulates a user pressing a key (without releasing it yet).
00356         
00357         'locator' is an element locator
00358         'keySequence' is Either be a string("\" followed by the numeric keycode  of the key to be pressed, normally the ASCII value of that key), or a single  character. For example: "w", "\119".
00359         """
00360         self.do_command("keyDown", [locator,keySequence,])
00361 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.key_press (   self,
  locator,
  keySequence 
)
Simulates a user pressing and releasing a key.

'locator' is an element locator
'keySequence' is Either be a string("\" followed by the numeric keycode  of the key to be pressed, normally the ASCII value of that key), or a single  character. For example: "w", "\119".

Definition at line 278 of file selenium.py.

00278 
00279     def key_press(self,locator,keySequence):
00280         """
00281         Simulates a user pressing and releasing a key.
00282         
00283         'locator' is an element locator
00284         'keySequence' is Either be a string("\" followed by the numeric keycode  of the key to be pressed, normally the ASCII value of that key), or a single  character. For example: "w", "\119".
00285         """
00286         self.do_command("keyPress", [locator,keySequence,])
00287 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.key_up (   self,
  locator,
  keySequence 
)
Simulates a user releasing a key.

'locator' is an element locator
'keySequence' is Either be a string("\" followed by the numeric keycode  of the key to be pressed, normally the ASCII value of that key), or a single  character. For example: "w", "\119".

Definition at line 362 of file selenium.py.

00362 
00363     def key_up(self,locator,keySequence):
00364         """
00365         Simulates a user releasing a key.
00366         
00367         'locator' is an element locator
00368         'keySequence' is Either be a string("\" followed by the numeric keycode  of the key to be pressed, normally the ASCII value of that key), or a single  character. For example: "w", "\119".
00369         """
00370         self.do_command("keyUp", [locator,keySequence,])
00371 

Here is the call graph for this function:

Press the meta key and hold it down until doMetaUp() is called or a new page is loaded.

Definition at line 304 of file selenium.py.

00304 
00305     def meta_key_down(self):
00306         """
00307         Press the meta key and hold it down until doMetaUp() is called or a new page is loaded.
00308         
00309         """
00310         self.do_command("metaKeyDown", [])
00311 

Here is the call graph for this function:

Release the meta key.

Definition at line 312 of file selenium.py.

00312 
00313     def meta_key_up(self):
00314         """
00315         Release the meta key.
00316         
00317         """
00318         self.do_command("metaKeyUp", [])
00319 

Here is the call graph for this function:

Simulates a user pressing the mouse button (without releasing it yet) on
the specified element.

'locator' is an element locator

Definition at line 390 of file selenium.py.

00390 
00391     def mouse_down(self,locator):
00392         """
00393         Simulates a user pressing the mouse button (without releasing it yet) on
00394         the specified element.
00395         
00396         'locator' is an element locator
00397         """
00398         self.do_command("mouseDown", [locator,])
00399 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.mouse_down_at (   self,
  locator,
  coordString 
)
Simulates a user pressing the mouse button (without releasing it yet) on
the specified element.

'locator' is an element locator
'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse      event relative to the element returned by the locator.

Definition at line 400 of file selenium.py.

00400 
00401     def mouse_down_at(self,locator,coordString):
00402         """
00403         Simulates a user pressing the mouse button (without releasing it yet) on
00404         the specified element.
00405         
00406         'locator' is an element locator
00407         'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse      event relative to the element returned by the locator.
00408         """
00409         self.do_command("mouseDownAt", [locator,coordString,])
00410 

Here is the call graph for this function:

Simulates a user pressing the mouse button (without releasing it yet) on
the specified element.

'locator' is an element locator

Definition at line 432 of file selenium.py.

00432 
00433     def mouse_move(self,locator):
00434         """
00435         Simulates a user pressing the mouse button (without releasing it yet) on
00436         the specified element.
00437         
00438         'locator' is an element locator
00439         """
00440         self.do_command("mouseMove", [locator,])
00441 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.mouse_move_at (   self,
  locator,
  coordString 
)
Simulates a user pressing the mouse button (without releasing it yet) on
the specified element.

'locator' is an element locator
'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse      event relative to the element returned by the locator.

Definition at line 442 of file selenium.py.

00442 
00443     def mouse_move_at(self,locator,coordString):
00444         """
00445         Simulates a user pressing the mouse button (without releasing it yet) on
00446         the specified element.
00447         
00448         'locator' is an element locator
00449         'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse      event relative to the element returned by the locator.
00450         """
00451         self.do_command("mouseMoveAt", [locator,coordString,])
00452 

Here is the call graph for this function:

Simulates a user moving the mouse pointer away from the specified element.

'locator' is an element locator

Definition at line 381 of file selenium.py.

00381 
00382     def mouse_out(self,locator):
00383         """
00384         Simulates a user moving the mouse pointer away from the specified element.
00385         
00386         'locator' is an element locator
00387         """
00388         self.do_command("mouseOut", [locator,])
00389 

Here is the call graph for this function:

Simulates a user hovering a mouse over the specified element.

'locator' is an element locator

Definition at line 372 of file selenium.py.

00372 
00373     def mouse_over(self,locator):
00374         """
00375         Simulates a user hovering a mouse over the specified element.
00376         
00377         'locator' is an element locator
00378         """
00379         self.do_command("mouseOver", [locator,])
00380 

Here is the call graph for this function:

Simulates a user pressing the mouse button (without releasing it yet) on
the specified element.

'locator' is an element locator

Definition at line 411 of file selenium.py.

00411 
00412     def mouse_up(self,locator):
00413         """
00414         Simulates a user pressing the mouse button (without releasing it yet) on
00415         the specified element.
00416         
00417         'locator' is an element locator
00418         """
00419         self.do_command("mouseUp", [locator,])
00420 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.mouse_up_at (   self,
  locator,
  coordString 
)
Simulates a user pressing the mouse button (without releasing it yet) on
the specified element.

'locator' is an element locator
'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse      event relative to the element returned by the locator.

Definition at line 421 of file selenium.py.

00421 
00422     def mouse_up_at(self,locator,coordString):
00423         """
00424         Simulates a user pressing the mouse button (without releasing it yet) on
00425         the specified element.
00426         
00427         'locator' is an element locator
00428         'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse      event relative to the element returned by the locator.
00429         """
00430         self.do_command("mouseUpAt", [locator,coordString,])
00431 

Here is the call graph for this function:

Opens an URL in the test frame. This accepts both relative and absolute
URLs.

The "open" command waits for the page to load before proceeding,
ie. the "AndWait" suffix is implicit.

\ *Note*: The URL must be on the same domain as the runner HTML
due to security restrictions in the browser (Same Origin Policy). If you
need to open an URL on another domain, use the Selenium Server to start a
new browser session on that domain.

'url' is the URL to open; may be relative or absolute

Definition at line 583 of file selenium.py.

00583 
00584     def open(self,url):
00585         """
00586         Opens an URL in the test frame. This accepts both relative and absolute
00587         URLs.
00588         
00589         The "open" command waits for the page to load before proceeding,
00590         ie. the "AndWait" suffix is implicit.
00591         
00592         \ *Note*: The URL must be on the same domain as the runner HTML
00593         due to security restrictions in the browser (Same Origin Policy). If you
00594         need to open an URL on another domain, use the Selenium Server to start a
00595         new browser session on that domain.
00596         
00597         'url' is the URL to open; may be relative or absolute
00598         """
00599         self.do_command("open", [url,])
00600 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.open_window (   self,
  url,
  windowID 
)
Opens a popup window (if a window with that ID isn't already open).
After opening the window, you'll need to select it using the selectWindow
command.

This command can also be a useful workaround for bug SEL-339.  In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example).
In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using
an empty (blank) url, like this: openWindow("", "myFunnyWindow").


'url' is the URL to open, which can be blank
'windowID' is the JavaScript window ID of the window to select

Definition at line 601 of file selenium.py.

00601 
00602     def open_window(self,url,windowID):
00603         """
00604         Opens a popup window (if a window with that ID isn't already open).
00605         After opening the window, you'll need to select it using the selectWindow
00606         command.
00607         
00608         This command can also be a useful workaround for bug SEL-339.  In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example).
00609         In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using
00610         an empty (blank) url, like this: openWindow("", "myFunnyWindow").
00611         
00612         
00613         'url' is the URL to open, which can be blank
00614         'windowID' is the JavaScript window ID of the window to select
00615         """
00616         self.do_command("openWindow", [url,windowID,])
00617 

Here is the call graph for this function:

Simulates the user clicking the "Refresh" button on their browser.

Definition at line 750 of file selenium.py.

00750 
00751     def refresh(self):
00752         """
00753         Simulates the user clicking the "Refresh" button on their browser.
00754         
00755         """
00756         self.do_command("refresh", [])
00757 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.remove_selection (   self,
  locator,
  optionLocator 
)
Remove a selection from the set of selected options in a multi-select element using an option locator.

@see #doSelect for details of option locators

'locator' is an element locator identifying a multi-select box
'optionLocator' is an option locator (a label by default)

Definition at line 561 of file selenium.py.

00561 
00562     def remove_selection(self,locator,optionLocator):
00563         """
00564         Remove a selection from the set of selected options in a multi-select element using an option locator.
00565         
00566         @see #doSelect for details of option locators
00567         
00568         'locator' is an element locator identifying a multi-select box
00569         'optionLocator' is an option locator (a label by default)
00570         """
00571         self.do_command("removeSelection", [locator,optionLocator,])
00572 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.select (   self,
  selectLocator,
  optionLocator 
)
Select an option from a drop-down using an option locator.


Option locators provide different ways of specifying options of an HTML
Select element (e.g. for selecting a specific option, or for asserting
that the selected option satisfies a specification). There are several
forms of Select Option Locator.

*    \ **label**\ =\ *labelPattern*
    matches options based on their labels, i.e. the visible text. (This
    is the default.)
    *    label=regexp:^[Oo]ther
    
    
*    \ **value**\ =\ *valuePattern*
    matches options based on their values.
    *    value=other
    
    
*    \ **id**\ =\ *id*
    matches options based on their ids.
    *    id=option1
    
    
*    \ **index**\ =\ *index*
    matches an option based on its index (offset from zero).
    *    index=2
    
    


If no option locator prefix is provided, the default behaviour is to match on \ **label**\ .



'selectLocator' is an element locator identifying a drop-down menu
'optionLocator' is an option locator (a label by default)

Definition at line 506 of file selenium.py.

00506 
00507     def select(self,selectLocator,optionLocator):
00508         """
00509         Select an option from a drop-down using an option locator.
00510         
00511         
00512         Option locators provide different ways of specifying options of an HTML
00513         Select element (e.g. for selecting a specific option, or for asserting
00514         that the selected option satisfies a specification). There are several
00515         forms of Select Option Locator.
00516         
00517         *    \ **label**\ =\ *labelPattern*
00518             matches options based on their labels, i.e. the visible text. (This
00519             is the default.)
00520             *    label=regexp:^[Oo]ther
00521             
00522             
00523         *    \ **value**\ =\ *valuePattern*
00524             matches options based on their values.
00525             *    value=other
00526             
00527             
00528         *    \ **id**\ =\ *id*
00529             matches options based on their ids.
00530             *    id=option1
00531             
00532             
00533         *    \ **index**\ =\ *index*
00534             matches an option based on its index (offset from zero).
00535             *    index=2
00536             
00537             
00538         
00539         
00540         If no option locator prefix is provided, the default behaviour is to match on \ **label**\ .
00541         
00542         
00543         
00544         'selectLocator' is an element locator identifying a drop-down menu
00545         'optionLocator' is an option locator (a label by default)
00546         """
00547         self.do_command("select", [selectLocator,optionLocator,])
00548 

Here is the call graph for this function:

Selects a frame within the current window.  (You may invoke this command
multiple times to select nested frames.)  To select the parent frame, use
"relative=parent" as a locator; to select the top frame, use "relative=top".

You may also use a DOM expression to identify the frame you want directly,
like this: ``dom=frames["main"].frames["subframe"]``


'locator' is an element locator identifying a frame or iframe

Definition at line 645 of file selenium.py.

00645 
00646     def select_frame(self,locator):
00647         """
00648         Selects a frame within the current window.  (You may invoke this command
00649         multiple times to select nested frames.)  To select the parent frame, use
00650         "relative=parent" as a locator; to select the top frame, use "relative=top".
00651         
00652         You may also use a DOM expression to identify the frame you want directly,
00653         like this: ``dom=frames["main"].frames["subframe"]``
00654         
00655         
00656         'locator' is an element locator identifying a frame or iframe
00657         """
00658         self.do_command("selectFrame", [locator,])
00659 

Here is the call graph for this function:

Selects a popup window; once a popup window has been selected, all
commands go to that window. To select the main window again, use null
as the target.

Selenium has several strategies for finding the window object referred to by the "windowID" parameter.
1.) if windowID is null, then it is assumed the user is referring to the original window instantiated by the browser).
2.) if the value of the "windowID" parameter is a JavaScript variable name in the current application window, then it is assumed
that this variable contains the return value from a call to the JavaScript window.open() method.
3.) Otherwise, selenium looks in a hash it maintains that maps string names to window objects.  Each of these string 
names matches the second parameter "windowName" past to the JavaScript method  window.open(url, windowName, windowFeatures, replaceFlag)
(which selenium intercepts).
If you're having trouble figuring out what is the name of a window that you want to manipulate, look at the selenium log messages
which identify the names of windows created via window.open (and therefore intercepted by selenium).  You will see messages
like the following for each window as it is opened:
``debug: window.open call intercepted; window ID (which you can use with selectWindow()) is "myNewWindow"``
In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example).
(This is bug SEL-339.)  In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using
an empty (blank) url, like this: openWindow("", "myFunnyWindow").


'windowID' is the JavaScript window ID of the window to select

Definition at line 618 of file selenium.py.

00618 
00619     def select_window(self,windowID):
00620         """
00621         Selects a popup window; once a popup window has been selected, all
00622         commands go to that window. To select the main window again, use null
00623         as the target.
00624         
00625         Selenium has several strategies for finding the window object referred to by the "windowID" parameter.
00626         1.) if windowID is null, then it is assumed the user is referring to the original window instantiated by the browser).
00627         2.) if the value of the "windowID" parameter is a JavaScript variable name in the current application window, then it is assumed
00628         that this variable contains the return value from a call to the JavaScript window.open() method.
00629         3.) Otherwise, selenium looks in a hash it maintains that maps string names to window objects.  Each of these string 
00630         names matches the second parameter "windowName" past to the JavaScript method  window.open(url, windowName, windowFeatures, replaceFlag)
00631         (which selenium intercepts).
00632         If you're having trouble figuring out what is the name of a window that you want to manipulate, look at the selenium log messages
00633         which identify the names of windows created via window.open (and therefore intercepted by selenium).  You will see messages
00634         like the following for each window as it is opened:
00635         ``debug: window.open call intercepted; window ID (which you can use with selectWindow()) is "myNewWindow"``
00636         In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example).
00637         (This is bug SEL-339.)  In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using
00638         an empty (blank) url, like this: openWindow("", "myFunnyWindow").
00639         
00640         
00641         'windowID' is the JavaScript window ID of the window to select
00642         """
00643         self.do_command("selectWindow", [windowID,])
00644 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.set_context (   self,
  context,
  logLevelThreshold 
)
Writes a message to the status bar and adds a note to the browser-side
log.

If logLevelThreshold is specified, set the threshold for logging
to that level (debug, info, warn, error).
(Note that the browser-side logs will \ *not* be sent back to the
server, and are invisible to the Client Driver.)


'context' is the message to be sent to the browser
'logLevelThreshold' is one of "debug", "info", "warn", "error", sets the threshold for browser-side logging

Definition at line 1300 of file selenium.py.

01300 
01301     def set_context(self,context,logLevelThreshold):
01302         """
01303         Writes a message to the status bar and adds a note to the browser-side
01304         log.
01305         
01306         If logLevelThreshold is specified, set the threshold for logging
01307         to that level (debug, info, warn, error).
01308         (Note that the browser-side logs will \ *not* be sent back to the
01309         server, and are invisible to the Client Driver.)
01310         
01311         
01312         'context' is the message to be sent to the browser
01313         'logLevelThreshold' is one of "debug", "info", "warn", "error", sets the threshold for browser-side logging
01314         """
01315         self.do_command("setContext", [context,logLevelThreshold,])
01316 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.set_cursor_position (   self,
  locator,
  position 
)
Moves the text cursor to the specified position in the given input element or textarea.
This method will fail if the specified element isn't an input element or textarea.

'locator' is an element locator pointing to an input element or textarea
'position' is the numerical position of the cursor in the field; position should be 0 to move the position to the beginning of the field.  You can also set the cursor to -1 to move it to the end of the field.

Definition at line 1218 of file selenium.py.

01218 
01219     def set_cursor_position(self,locator,position):
01220         """
01221         Moves the text cursor to the specified position in the given input element or textarea.
01222         This method will fail if the specified element isn't an input element or textarea.
01223         
01224         'locator' is an element locator pointing to an input element or textarea
01225         'position' is the numerical position of the cursor in the field; position should be 0 to move the position to the beginning of the field.  You can also set the cursor to -1 to move it to the end of the field.
01226         """
01227         self.do_command("setCursorPosition", [locator,position,])
01228 

Here is the call graph for this function:

Set execution speed (i.e., set the millisecond length of a delay which will follow each selenium operation).  By default, there is no such delay, i.e.,
the delay is 0 milliseconds.

'value' is the number of milliseconds to pause after operation

Definition at line 467 of file selenium.py.

00467 
00468     def set_speed(self,value):
00469         """
00470         Set execution speed (i.e., set the millisecond length of a delay which will follow each selenium operation).  By default, there is no such delay, i.e.,
00471         the delay is 0 milliseconds.
00472         
00473         'value' is the number of milliseconds to pause after operation
00474         """
00475         self.do_command("setSpeed", [value,])
00476 

Here is the call graph for this function:

Specifies the amount of time that Selenium will wait for actions to complete.

Actions that require waiting include "open" and the "waitFor*" actions.

The default timeout is 30 seconds.

'timeout' is a timeout in milliseconds, after which the action will return with an error

Definition at line 1348 of file selenium.py.

01348 
01349     def set_timeout(self,timeout):
01350         """
01351         Specifies the amount of time that Selenium will wait for actions to complete.
01352         
01353         Actions that require waiting include "open" and the "waitFor*" actions.
01354         
01355         The default timeout is 30 seconds.
01356         
01357         'timeout' is a timeout in milliseconds, after which the action will return with an error
01358         """
01359         self.do_command("setTimeout", [timeout,])
01360 

Here is the call graph for this function:

Press the shift key and hold it down until doShiftUp() is called or a new page is loaded.

Definition at line 288 of file selenium.py.

00288 
00289     def shift_key_down(self):
00290         """
00291         Press the shift key and hold it down until doShiftUp() is called or a new page is loaded.
00292         
00293         """
00294         self.do_command("shiftKeyDown", [])
00295 

Here is the call graph for this function:

Release the shift key.

Definition at line 296 of file selenium.py.

00296 
00297     def shift_key_up(self):
00298         """
00299         Release the shift key.
00300         
00301         """
00302         self.do_command("shiftKeyUp", [])
00303 

Here is the call graph for this function:

Definition at line 134 of file selenium.py.

00134 
00135     def start(self):
00136         result = self.get_string("getNewBrowserSession", [self.browserStartCommand, self.browserURL])
00137         try:
00138             self.sessionId = long(result)
00139         except ValueError:
00140             raise Exception, result
        

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 141 of file selenium.py.

00141 
00142     def stop(self):
00143         self.do_command("testComplete", [])
00144         self.sessionId = None

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.submit (   self,
  formLocator 
)
Submit the specified form. This is particularly useful for forms without
submit buttons, e.g. single-input "Search" forms.

'formLocator' is an element locator for the form you want to submit

Definition at line 573 of file selenium.py.

00573 
00574     def submit(self,formLocator):
00575         """
00576         Submit the specified form. This is particularly useful for forms without
00577         submit buttons, e.g. single-input "Search" forms.
00578         
00579         'formLocator' is an element locator for the form you want to submit
00580         """
00581         self.do_command("submit", [formLocator,])
00582 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.type (   self,
  locator,
  value 
)
Sets the value of an input field, as though you typed it in.

Can also be used to set the value of combo boxes, check boxes, etc. In these cases,
value should be the value of the option selected, not the visible text.


'locator' is an element locator
'value' is the value to type

Definition at line 453 of file selenium.py.

00453 
00454     def type(self,locator,value):
00455         """
00456         Sets the value of an input field, as though you typed it in.
00457         
00458         Can also be used to set the value of combo boxes, check boxes, etc. In these cases,
00459         value should be the value of the option selected, not the visible text.
00460         
00461         
00462         'locator' is an element locator
00463         'value' is the value to type
00464         """
00465         self.do_command("type", [locator,value,])
00466 

Here is the call graph for this function:

Here is the caller graph for this function:

Uncheck a toggle-button (checkbox/radio)

'locator' is an element locator

Definition at line 497 of file selenium.py.

00497 
00498     def uncheck(self,locator):
00499         """
00500         Uncheck a toggle-button (checkbox/radio)
00501         
00502         'locator' is an element locator
00503         """
00504         self.do_command("uncheck", [locator,])
00505 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.wait_for_condition (   self,
  script,
  timeout 
)
Runs the specified JavaScript snippet repeatedly until it evaluates to "true".
The snippet may have multiple lines, but only the result of the last line
will be considered.

Note that, by default, the snippet will be run in the runner's test window, not in the window
of your application.  To get the window of your application, you can use
the JavaScript snippet ``selenium.browserbot.getCurrentWindow()``, and then
run your JavaScript in there


'script' is the JavaScript snippet to run
'timeout' is a timeout in milliseconds, after which this command will return with an error

Definition at line 1330 of file selenium.py.

01330 
01331     def wait_for_condition(self,script,timeout):
01332         """
01333         Runs the specified JavaScript snippet repeatedly until it evaluates to "true".
01334         The snippet may have multiple lines, but only the result of the last line
01335         will be considered.
01336         
01337         Note that, by default, the snippet will be run in the runner's test window, not in the window
01338         of your application.  To get the window of your application, you can use
01339         the JavaScript snippet ``selenium.browserbot.getCurrentWindow()``, and then
01340         run your JavaScript in there
01341         
01342         
01343         'script' is the JavaScript snippet to run
01344         'timeout' is a timeout in milliseconds, after which this command will return with an error
01345         """
01346         self.do_command("waitForCondition", [script,timeout,])
01347 

Here is the call graph for this function:

Waits for a new page to load.

You can use this command instead of the "AndWait" suffixes, "clickAndWait", "selectAndWait", "typeAndWait" etc.
(which are only available in the JS API).
Selenium constantly keeps track of new pages loading, and sets a "newPageLoaded"
flag when it first notices a page load.  Running any other Selenium command after
turns the flag to false.  Hence, if you want to wait for a page to load, you must
wait immediately after a Selenium command that caused a page-load.


'timeout' is a timeout in milliseconds, after which this command will return with an error

Definition at line 1361 of file selenium.py.

01361 
01362     def wait_for_page_to_load(self,timeout):
01363         """
01364         Waits for a new page to load.
01365         
01366         You can use this command instead of the "AndWait" suffixes, "clickAndWait", "selectAndWait", "typeAndWait" etc.
01367         (which are only available in the JS API).
01368         Selenium constantly keeps track of new pages loading, and sets a "newPageLoaded"
01369         flag when it first notices a page load.  Running any other Selenium command after
01370         turns the flag to false.  Hence, if you want to wait for a page to load, you must
01371         wait immediately after a Selenium command that caused a page-load.
01372         
01373         
01374         'timeout' is a timeout in milliseconds, after which this command will return with an error
01375         """
01376         self.do_command("waitForPageToLoad", [timeout,])
01377 

Here is the call graph for this function:

def kss.demo.selenium_utils.selenium.selenium.wait_for_pop_up (   self,
  windowID,
  timeout 
)
Waits for a popup window to appear and load up.

'windowID' is the JavaScript window ID of the window that will appear
'timeout' is a timeout in milliseconds, after which the action will return with an error

Definition at line 711 of file selenium.py.

00711 
00712     def wait_for_pop_up(self,windowID,timeout):
00713         """
00714         Waits for a popup window to appear and load up.
00715         
00716         'windowID' is the JavaScript window ID of the window that will appear
00717         'timeout' is a timeout in milliseconds, after which the action will return with an error
00718         """
00719         self.do_command("waitForPopUp", [windowID,timeout,])
00720 

Here is the call graph for this function:

Gives focus to a window

'windowName' is name of the window to be given focus

Definition at line 1167 of file selenium.py.

01167 
01168     def window_focus(self,windowName):
01169         """
01170         Gives focus to a window
01171         
01172         'windowName' is name of the window to be given focus
01173         """
01174         self.do_command("windowFocus", [windowName,])
01175 

Here is the call graph for this function:

Resize window to take up the entire screen

'windowName' is name of the window to be enlarged

Definition at line 1176 of file selenium.py.

01176 
01177     def window_maximize(self,windowName):
01178         """
01179         Resize window to take up the entire screen
01180         
01181         'windowName' is name of the window to be enlarged
01182         """
01183         self.do_command("windowMaximize", [windowName,])
01184 

Here is the call graph for this function:


Member Data Documentation

Definition at line 130 of file selenium.py.

Definition at line 131 of file selenium.py.

Definition at line 128 of file selenium.py.

Definition at line 129 of file selenium.py.

Definition at line 132 of file selenium.py.


The documentation for this class was generated from the following file: