def login_button(self): login_button_file = self.field[4].text login_field = Element.fetch_element_by_id(self.driver, login_button_file) login_field_value = login_field.text print(login_field_value) return login_field
def login_text(self): """This def is used to find if the text "login" is present on the page""" login_text_file = self.field[1].text login_text = Element.fetch_element_by_xpath(self.driver, login_text_file).text print(login_text) return login_text
def password_field(self): password_field_file = self.field[3].text password_field = Element.fetch_element_by_id(self.driver, password_field_file) password_field_value = password_field.get_attribute('name') print(password_field_value) return password_field
def flexera_logo(self): """This def is to check if "Flexera" logo is present on the login page""" logo_field = self.field[0].text logo = Element.fetch_element_by_xpath( self.driver, logo_field).get_attribute('class') print(logo) return logo
def username_field(self): """This def is to check if the "username" field is present on the login page""" username_field_file = self.field[2].text # global username_field username_field = Element.fetch_element_by_id(self.driver, username_field_file) # global username_field_value username_field_value = username_field.get_attribute('name') print(username_field_value) return username_field
def remove_all_widgets(self): remove_gadgets_file = self.field[1].text element1 = Element.fetch_elements_by_classname(self.driver, remove_gadgets_file) print(len(element1)) time.sleep(2) for x in range(0, len(element1)): if element1[x].is_displayed(): element1[x].click() time.sleep(10) self.dashboard.save_button().click()
def error_message(self): error_from_file = self.field[7].text error_message = Element.fetch_element_by_xpath(self.driver, error_from_file).text return error_message
def get_available_gadgets(self): add_gadgets_file = self.field[3].text add_gadgets = Element.fetch_element_by_xpath(self.driver, add_gadgets_file) return add_gadgets
def remove_gadgets(self): remove_gadgets_file = self.field[1].text remove_gadget = Element.fetch_element_by_class(self.driver, remove_gadgets_file) return remove_gadget