コード例 #1
0
    def __read_attributes_from_map(self, locator):
        app_name = mapMgr.__getitem__(locator)["APP_NAME"].strip("'")
        control_identifiers = mapMgr.__getitem__(locator)["IDENTIFIERS"].split(
            ",")

        search_criteria = {
            i.split("=")[0]: i.split("=")[1].strip('"')
            for i in control_identifiers
        }
        return app_name, search_criteria
コード例 #2
0
 def _map_converter(self, locator):
     '''
     map_converter() - Gets element attributes from map files
     Return dictionary
     '''
     self.elementAttr = mapMgr.__getitem__(locator)
     print("The Xpath value is : ", self.elementAttr)
     print("The Xpath Name is  : ", locator)
     return self.elementAttr
コード例 #3
0
 def click(self, locator):
     """
     Clicks on an element identified by locator
     :param locator: user defined name from map files
     Ex: click("locator_name")
     """
     locator = self.__get_locator_for_tool(locator)
     window_identifier, control_identifier = mapMgr.__getitem__(
         locator)["IDENTIFIERS"].strip("'").split(",")
     autoit.control_click(window_identifier, control_identifier.strip('"'))
コード例 #4
0
 def activate_window(self, locator):
     """
     Activates a window identified by locator
     :param locator: user defined name from map files
     Ex: activate_window("locator_name")
     """
     locator = self.__get_locator_for_tool(locator)
     window_identifier = mapMgr.__getitem__(locator)["IDENTIFIERS"].strip(
         "'").split(",")[0]
     autoit.win_activate(window_identifier)
コード例 #5
0
 def send_text(self, locator, text):
     """
     Enters text in an input element identified by locator
     :param locator: user defined name from map files
     :param text: text which you want to enter
     Ex: send_text("locator_name", "hello")
     """
     locator = self.__get_locator_for_tool(locator)
     window_identifier, control_identifier = mapMgr.__getitem__(
         locator)["IDENTIFIERS"].strip("'").split(",")
     autoit.control_send(window_identifier, control_identifier.strip('"'),
                         text)
コード例 #6
0
 def send_key(self, locator, key):
     """
     Press any key on an element identified by locator
     :param locator: user defined name from map files
     :param key: key which you want to press
     Ex: send_key("locator_name", "ENTER")
     """
     locator = self.__get_locator_for_tool(locator)
     window_identifier, control_identifier = mapMgr.__getitem__(
         locator)["IDENTIFIERS"].strip("'").split(",")
     key = "{%s}" % key
     autoit.control_send(window_identifier, control_identifier.strip('"'),
                         key)
コード例 #7
0
ファイル: Browser.py プロジェクト: Vasuja-GL/GL_Projects
    def _map_converter(self, locator, replace_dict=None):
        '''
        map_converter() - Gets element attributes from map files
        Return dictionary
        '''
        self.elementAttr = copy.deepcopy(mapMgr.__getitem__(locator))
        if replace_dict:
            for key in replace_dict:
                xpath = self.elementAttr['BY_VALUE']
                r = '!' + key + '!'
                self.elementAttr['BY_VALUE'] = xpath.replace(
                    r, str(replace_dict[key]))

        info(self.elementAttr)
        return self.elementAttr