コード例 #1
0
    def __set_auth_filter(session, rsusr002_filter):
        SAPGuiElements.select_element(session, PRIVILEGE_TAB)

        for i, auth in enumerate(rsusr002_filter.auth_objects):
            if i >= MAX_AUTH_OBJECTS:
                break

            SAPGuiElements.try_to_set_text(
                session, AUTH_OBJECT_TEMPLATE.format(type="{type}", num=i + 1),
                auth.name)
            SAPGuiElements.press_keyboard_keys(session, "Enter")

            for k in range(0, 10):
                try:
                    text = SAPGuiElements.get_text(
                        session, FIELD_NAME_TEMPLATE.format(num=i + 1, num1=k))
                except AttributeError:
                    break
                else:
                    values = auth.get_values_for_field(text)

                    if not values or len(values) == 0:
                        continue

                    for j, value in enumerate(values):
                        if j >= MAX_AUTH_VALUES:
                            break
                        SAPGuiElements.try_to_set_text(
                            session,
                            AUTH_VALUES_TEMPLATE.format(type="{type}",
                                                        num=i + 1,
                                                        num1=k,
                                                        num2=j + 1), value)
コード例 #2
0
ファイル: se16.py プロジェクト: gutskodv/sap-security
 def __get_entries_number(self, session):
     SAPGuiElements.press_keyboard_keys(session, "Ctrl+F7")
     entries_num = SAPGuiElements.get_text(session, NUMBER_ENTRIES_FIELD)
     SAPGuiElements.press_keyboard_keys(session, "Enter", GUI_CHILD_WINDOW1)
     return self.__parse_val(entries_num)