<s> """<STR_LIT>""" <EOL> __docformat__ = "<STR_LIT>" <EOL> import httplib <EOL> import urllib <EOL> import re <EOL> class selenium : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , host , port , browserStartCommand , browserURL ) : <EOL> self . host = host <EOL> self . port = port <EOL> self . browserStartCommand = browserStartCommand <EOL> self . browserURL = browserURL <EOL> self . sessionId = None <EOL> self . extensionJs = "<STR_LIT>" <EOL> def setExtensionJs ( self , extensionJs ) : <EOL> self . extensionJs = extensionJs <EOL> def start ( self ) : <EOL> result = self . get_string ( "<STR_LIT>" , [ self . browserStartCommand , self . browserURL , self . extensionJs ] ) <EOL> try : <EOL> self . sessionId = result <EOL> except ValueError : <EOL> raise Exception , result <EOL> def stop ( self ) : <EOL> self . do_command ( "<STR_LIT>" , [ ] ) <EOL> self . sessionId = None <EOL> def do_command ( self , verb , args ) : <EOL> conn = httplib . HTTPConnection ( self . host , self . port ) <EOL> body = u'<STR_LIT>' + urllib . quote_plus ( unicode ( verb ) . encode ( '<STR_LIT:utf-8>' ) ) <EOL> for i in range ( len ( args ) ) : <EOL> body += '<STR_LIT:&>' + unicode ( i + <NUM_LIT:1> ) + '<STR_LIT:=>' + urllib . quote_plus ( unicode ( args [ i ] ) . encode ( '<STR_LIT:utf-8>' ) ) <EOL> if ( None != self . sessionId ) : <EOL> body += "<STR_LIT>" + unicode ( self . sessionId ) <EOL> headers = { "<STR_LIT:Content-Type>" : "<STR_LIT>" } <EOL> conn . request ( "<STR_LIT:POST>" , "<STR_LIT>" , body , headers ) <EOL> response = conn . getresponse ( ) <EOL> data = unicode ( response . read ( ) , "<STR_LIT>" ) <EOL> result = response . reason <EOL> if ( not data . startswith ( '<STR_LIT:OK>' ) ) : <EOL> raise Exception , data <EOL> return data <EOL> def get_string ( self , verb , args ) : <EOL> result = self . do_command ( verb , args ) <EOL> return result [ <NUM_LIT:3> : ] <EOL> def get_string_array ( self , verb , args ) : <EOL> csv = self . get_string ( verb , args ) <EOL> token = "<STR_LIT>" <EOL> tokens = [ ] <EOL> escape = False <EOL> for i in range ( len ( csv ) ) : <EOL> letter = csv [ i ] <EOL> if ( escape ) : <EOL> token = token + letter <EOL> escape = False <EOL> continue <EOL> if ( letter == '<STR_LIT:\\>' ) : <EOL> escape = True <EOL> elif ( letter == '<STR_LIT:U+002C>' ) : <EOL> tokens . append ( token ) <EOL> token = "<STR_LIT>" <EOL> else : <EOL> token = token + letter <EOL> tokens . append ( token ) <EOL> return tokens <EOL> def get_number ( self , verb , args ) : <EOL> return self . get_string ( verb , args ) <EOL> def get_number_array ( self , verb , args ) : <EOL> return self . get_string_array ( verb , args ) <EOL> def get_boolean ( self , verb , args ) : <EOL> boolstr = self . get_string ( verb , args ) <EOL> if ( "<STR_LIT:true>" == boolstr ) : <EOL> return True <EOL> if ( "<STR_LIT:false>" == boolstr ) : <EOL> return False <EOL> raise ValueError , "<STR_LIT>" + boolstr <EOL> def get_boolean_array ( self , verb , args ) : <EOL> boolarr = self . get_string_array ( verb , args ) <EOL> for i in range ( len ( boolarr ) ) : <EOL> if ( "<STR_LIT:true>" == boolstr ) : <EOL> boolarr [ i ] = True <EOL> continue <EOL> if ( "<STR_LIT:false>" == boolstr ) : <EOL> boolarr [ i ] = False <EOL> continue <EOL> raise ValueError , "<STR_LIT>" + boolarr [ i ] <EOL> return boolarr <EOL> def click ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> self . wait_for_element_present ( locator ) <EOL> self . do_command ( "<STR_LIT>" , [ locator , ] ) <EOL> def double_click ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> self . wait_for_element_present ( locator ) <EOL> self . do_command ( "<STR_LIT>" , [ locator , ] ) <EOL> def context_menu ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , ] ) <EOL> def click_at ( self , locator , coordString ) : <EOL> """<STR_LIT>""" <EOL> self . wait_for_element_present ( locator ) <EOL> self . do_command ( "<STR_LIT>" , [ locator , coordString , ] ) <EOL> def double_click_at ( self , locator , coordString ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , coordString , ] ) <EOL> def context_menu_at ( self , locator , coordString ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , coordString , ] ) <EOL> def fire_event ( self , locator , eventName ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , eventName , ] ) <EOL> def focus ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , ] ) <EOL> def key_press ( self , locator , keySequence ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , keySequence , ] ) <EOL> def shift_key_down ( self ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ ] ) <EOL> def shift_key_up ( self ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ ] ) <EOL> def meta_key_down ( self ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ ] ) <EOL> def meta_key_up ( self ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ ] ) <EOL> def alt_key_down ( self ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ ] ) <EOL> def alt_key_up ( self ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ ] ) <EOL> def control_key_down ( self ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ ] ) <EOL> def control_key_up ( self ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ ] ) <EOL> def key_down ( self , locator , keySequence ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , keySequence , ] ) <EOL> def key_up ( self , locator , keySequence ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , keySequence , ] ) <EOL> def mouse_over ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , ] ) <EOL> def mouse_out ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , ] ) <EOL> def mouse_down ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , ] ) <EOL> def mouse_down_right ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , ] ) <EOL> def mouse_down_at ( self , locator , coordString ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , coordString , ] ) <EOL> def mouse_down_right_at ( self , locator , coordString ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , coordString , ] ) <EOL> def mouse_up ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , ] ) <EOL> def mouse_up_right ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , ] ) <EOL> def mouse_up_at ( self , locator , coordString ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , coordString , ] ) <EOL> def mouse_up_right_at ( self , locator , coordString ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , coordString , ] ) <EOL> def mouse_move ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , ] ) <EOL> def mouse_move_at ( self , locator , coordString ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , coordString , ] ) <EOL> def type ( self , locator , value ) : <EOL> """<STR_LIT>""" <EOL> self . wait_for_element_present ( locator ) <EOL> self . do_command ( "<STR_LIT:type>" , [ locator , value , ] ) <EOL> def type_keys ( self , locator , value ) : <EOL> """<STR_LIT>""" <EOL> self . wait_for_element_present ( locator ) <EOL> self . do_command ( "<STR_LIT>" , [ locator , value , ] ) <EOL> def set_speed ( self , value ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ value , ] ) <EOL> def get_speed ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string ( "<STR_LIT>" , [ ] ) <EOL> def check ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , ] ) <EOL> def uncheck ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , ] ) <EOL> def select ( self , selectLocator , optionLocator ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ selectLocator , optionLocator , ] ) <EOL> def add_selection ( self , locator , optionLocator ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , optionLocator , ] ) <EOL> def remove_selection ( self , locator , optionLocator ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , optionLocator , ] ) <EOL> def remove_all_selections ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , ] ) <EOL> def submit ( self , formLocator ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ formLocator , ] ) <EOL> def open ( self , url ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ url , ] ) <EOL> def open_window ( self , url , windowID ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ url , windowID , ] ) <EOL> def select_window ( self , windowID ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ windowID , ] ) <EOL> def select_pop_up ( self , windowID ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ windowID , ] ) <EOL> def deselect_pop_up ( self ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ ] ) <EOL> def select_frame ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , ] ) <EOL> def get_whether_this_frame_match_frame_expression ( self , currentFrameString , target ) : <EOL> """<STR_LIT>""" <EOL> return self . get_boolean ( "<STR_LIT>" , [ currentFrameString , target , ] ) <EOL> def get_whether_this_window_match_window_expression ( self , currentWindowString , target ) : <EOL> """<STR_LIT>""" <EOL> return self . get_boolean ( "<STR_LIT>" , [ currentWindowString , target , ] ) <EOL> def wait_for_pop_up ( self , windowID , timeout ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ windowID , timeout , ] ) <EOL> def choose_cancel_on_next_confirmation ( self ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ ] ) <EOL> def choose_ok_on_next_confirmation ( self ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ ] ) <EOL> def answer_on_next_prompt ( self , answer ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ answer , ] ) <EOL> def go_back ( self ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ ] ) <EOL> def refresh ( self ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ ] ) <EOL> def close ( self ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ ] ) <EOL> def is_alert_present ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . get_boolean ( "<STR_LIT>" , [ ] ) <EOL> def is_prompt_present ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . get_boolean ( "<STR_LIT>" , [ ] ) <EOL> def is_confirmation_present ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . get_boolean ( "<STR_LIT>" , [ ] ) <EOL> def get_alert ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string ( "<STR_LIT>" , [ ] ) <EOL> def get_confirmation ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string ( "<STR_LIT>" , [ ] ) <EOL> def get_prompt ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string ( "<STR_LIT>" , [ ] ) <EOL> def get_location ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string ( "<STR_LIT>" , [ ] ) <EOL> def get_title ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string ( "<STR_LIT>" , [ ] ) <EOL> def get_body_text ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string ( "<STR_LIT>" , [ ] ) <EOL> def get_value ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> self . wait_for_element_present ( locator ) <EOL> return self . get_string ( "<STR_LIT>" , [ locator , ] ) <EOL> def get_text ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> self . wait_for_element_present ( locator ) <EOL> return self . get_string ( "<STR_LIT>" , [ locator , ] ) <EOL> def highlight ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , ] ) <EOL> def get_eval ( self , script ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string ( "<STR_LIT>" , [ script , ] ) <EOL> def is_checked ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> return self . get_boolean ( "<STR_LIT>" , [ locator , ] ) <EOL> def get_table ( self , tableCellAddress ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string ( "<STR_LIT>" , [ tableCellAddress , ] ) <EOL> def get_selected_labels ( self , selectLocator ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string_array ( "<STR_LIT>" , [ selectLocator , ] ) <EOL> def get_selected_label ( self , selectLocator ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string ( "<STR_LIT>" , [ selectLocator , ] ) <EOL> def get_selected_values ( self , selectLocator ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string_array ( "<STR_LIT>" , [ selectLocator , ] ) <EOL> def get_selected_value ( self , selectLocator ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string ( "<STR_LIT>" , [ selectLocator , ] ) <EOL> def get_selected_indexes ( self , selectLocator ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string_array ( "<STR_LIT>" , [ selectLocator , ] ) <EOL> def get_selected_index ( self , selectLocator ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string ( "<STR_LIT>" , [ selectLocator , ] ) <EOL> def get_selected_ids ( self , selectLocator ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string_array ( "<STR_LIT>" , [ selectLocator , ] ) <EOL> def get_selected_id ( self , selectLocator ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string ( "<STR_LIT>" , [ selectLocator , ] ) <EOL> def is_something_selected ( self , selectLocator ) : <EOL> """<STR_LIT>""" <EOL> return self . get_boolean ( "<STR_LIT>" , [ selectLocator , ] ) <EOL> def get_select_options ( self , selectLocator ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string_array ( "<STR_LIT>" , [ selectLocator , ] ) <EOL> def get_attribute ( self , attributeLocator ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string ( "<STR_LIT>" , [ attributeLocator , ] ) <EOL> def is_text_present ( self , pattern ) : <EOL> """<STR_LIT>""" <EOL> return self . get_boolean ( "<STR_LIT>" , [ pattern , ] ) <EOL> def is_element_present ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> return self . get_boolean ( "<STR_LIT>" , [ locator , ] ) <EOL> def is_visible ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> return self . get_boolean ( "<STR_LIT>" , [ locator , ] ) <EOL> def is_editable ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> return self . get_boolean ( "<STR_LIT>" , [ locator , ] ) <EOL> def get_all_buttons ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string_array ( "<STR_LIT>" , [ ] ) <EOL> def get_all_links ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string_array ( "<STR_LIT>" , [ ] ) <EOL> def get_all_fields ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string_array ( "<STR_LIT>" , [ ] ) <EOL> def get_attribute_from_all_windows ( self , attributeName ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string_array ( "<STR_LIT>" , [ attributeName , ] ) <EOL> def dragdrop ( self , locator , movementsString ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , movementsString , ] ) <EOL> def set_mouse_speed ( self , pixels ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ pixels , ] ) <EOL> def get_mouse_speed ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . get_number ( "<STR_LIT>" , [ ] ) <EOL> def drag_and_drop ( self , locator , movementsString ) : <EOL> """<STR_LIT>""" <EOL> self . wait_for_element_present ( locator ) <EOL> self . do_command ( "<STR_LIT>" , [ locator , movementsString , ] ) <EOL> def drag_and_drop_to_object ( self , locatorOfObjectToBeDragged , locatorOfDragDestinationObject ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locatorOfObjectToBeDragged , locatorOfDragDestinationObject , ] ) <EOL> def window_focus ( self ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ ] ) <EOL> def window_maximize ( self ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ ] ) <EOL> def get_all_window_ids ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string_array ( "<STR_LIT>" , [ ] ) <EOL> def get_all_window_names ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string_array ( "<STR_LIT>" , [ ] ) <EOL> def get_all_window_titles ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string_array ( "<STR_LIT>" , [ ] ) <EOL> def get_html_source ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string ( "<STR_LIT>" , [ ] ) <EOL> def set_cursor_position ( self , locator , position ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , position , ] ) <EOL> def get_element_index ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> return self . get_number ( "<STR_LIT>" , [ locator , ] ) <EOL> def is_ordered ( self , locator1 , locator2 ) : <EOL> """<STR_LIT>""" <EOL> return self . get_boolean ( "<STR_LIT>" , [ locator1 , locator2 , ] ) <EOL> def get_element_position_left ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> return self . get_number ( "<STR_LIT>" , [ locator , ] ) <EOL> def get_element_position_top ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> return self . get_number ( "<STR_LIT>" , [ locator , ] ) <EOL> def get_element_width ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> return self . get_number ( "<STR_LIT>" , [ locator , ] ) <EOL> def get_element_height ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> return self . get_number ( "<STR_LIT>" , [ locator , ] ) <EOL> def get_cursor_position ( self , locator ) : <EOL> """<STR_LIT>""" <EOL> return self . get_number ( "<STR_LIT>" , [ locator , ] ) <EOL> def get_expression ( self , expression ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string ( "<STR_LIT>" , [ expression , ] ) <EOL> def get_xpath_count ( self , xpath ) : <EOL> """<STR_LIT>""" <EOL> return self . get_number ( "<STR_LIT>" , [ xpath , ] ) <EOL> def assign_id ( self , locator , identifier ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ locator , identifier , ] ) <EOL> def allow_native_xpath ( self , allow ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ allow , ] ) <EOL> def ignore_attributes_without_value ( self , ignore ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ ignore , ] ) <EOL> def wait_for_condition ( self , script , timeout ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ script , timeout , ] ) <EOL> def set_timeout ( self , timeout ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ timeout , ] ) <EOL> def wait_for_page_to_load ( self , timeout ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ timeout , ] ) <EOL> def wait_for_frame_to_load ( self , frameAddress , timeout ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ frameAddress , timeout , ] ) <EOL> def get_cookie ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string ( "<STR_LIT>" , [ ] ) <EOL> def get_cookie_by_name ( self , name ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string ( "<STR_LIT>" , [ name , ] ) <EOL> def is_cookie_present ( self , name ) : <EOL> """<STR_LIT>""" <EOL> return self . get_boolean ( "<STR_LIT>" , [ name , ] ) <EOL> def create_cookie ( self , nameValuePair , optionsString ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ nameValuePair , optionsString , ] ) <EOL> def delete_cookie ( self , name , optionsString ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ name , optionsString , ] ) <EOL> def delete_all_visible_cookies ( self ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ ] ) <EOL> def set_browser_log_level ( self , logLevel ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ logLevel , ] ) <EOL> def run_script ( self , script ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ script , ] ) <EOL> def add_location_strategy ( self , strategyName , functionDefinition ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ strategyName , functionDefinition , ] ) <EOL> def capture_entire_page_screenshot ( self , filename , kwargs ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ filename , kwargs , ] ) <EOL> def rollup ( self , rollupName , kwargs ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ rollupName , kwargs , ] ) <EOL> def add_script ( self , scriptContent , scriptTagId ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ scriptContent , scriptTagId , ] ) <EOL> def remove_script ( self , scriptTagId ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ scriptTagId , ] ) <EOL> def use_xpath_library ( self , libraryName ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ libraryName , ] ) <EOL> def set_context ( self , context ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ context , ] ) <EOL> def attach_file ( self , fieldLocator , fileLocator ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ fieldLocator , fileLocator , ] ) <EOL> def capture_screenshot ( self , filename ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ filename , ] ) <EOL> def capture_screenshot_to_string ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string ( "<STR_LIT>" , [ ] ) <EOL> def captureNetworkTraffic ( self , type ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string ( "<STR_LIT>" , [ type , ] ) <EOL> def addCustomRequestHeader ( self , key , value ) : <EOL> """<STR_LIT>""" <EOL> return self . do_command ( "<STR_LIT>" , [ key , value , ] ) <EOL> capture_network_traffic = captureNetworkTraffic <EOL> add_custom_request_header = addCustomRequestHeader <EOL> def capture_entire_page_screenshot_to_string ( self , kwargs ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string ( "<STR_LIT>" , [ kwargs , ] ) <EOL> def shut_down_selenium_server ( self ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ ] ) <EOL> def retrieve_last_remote_control_logs ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . get_string ( "<STR_LIT>" , [ ] ) <EOL> def key_down_native ( self , keycode ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ keycode , ] ) <EOL> def key_up_native ( self , keycode ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ keycode , ] ) <EOL> def key_press_native ( self , keycode ) : <EOL> """<STR_LIT>""" <EOL> self . do_command ( "<STR_LIT>" , [ keycode , ] ) <EOL> def wait_for_element_present ( self , locator ) : <EOL> self . do_command ( "<STR_LIT>" , [ locator , ] ) </s>
