コード例 #1
0
 def get_all_the_periods(self, reference, period, sic_code):
     self.periods = []
     self.periods = self.get_no_of_periods(self.periods)
     # Check if next button displayed then go to next page to get remaining periods
     while SeleniumCore.find_elements_by(
             *ContributorSearchPage.NEXT_BUTTON)[0].is_displayed():
         SeleniumCore.find_elements_by(
             *ContributorSearchPage.NEXT_BUTTON)[0].click()
         time.sleep(2)
         self.periods = self.get_no_of_periods(self.periods)
     self.select_the_form_row(reference, period, sic_code)
     return self.periods
コード例 #2
0
 def override_the_validation(self, question, type_of_check):
     question_row = self.get_question_code_row_details(
         contributor_details.CURRENT_DATA_TAB_ELEMENT, question)
     check_boxes = question_row.find_elements_by_name(
         contributor_details.OVERRIDE_CHECKBOX_ELEMENT)
     count = 0
     for i in range(0, len(check_boxes)):
         if type_of_check == 'validation' and check_boxes[i].get_attribute("checked") == "true" or \
                 type_of_check == 'override' and check_boxes[i].get_attribute("checked") != "true":
             check_boxes[i].click()
             count += 1
     if count >= 1:
         SeleniumCore.find_elements_by(
             *contributor_details.OVERRIDE_BUTTON)[0].click()
 def switch_to_the_tab(self, tab_name):
     elements = SeleniumCore.find_elements_by(*details.TAB_ELEMENTS)
     for ele in elements:
         if ele.text.lower() == tab_name.lower():
             ele.click()
             break
コード例 #4
0
 def get_no_of_validation_error_messages(self):
     return len(
         SeleniumCore.find_elements_by(
             By.XPATH, contributor_details.ERROR_MESSAGES_ELEMENT))