示例#1
0
 def get_obd_list_total_page_number(self):
     a = self.driver.get_element('x,//*[@id="paging-day"]').get_attribute(
         'style')
     if a == 'display: block;':
         new_paging = NewPaging(self.driver, self.base_url)
         return new_paging.get_total_page('x,//*[@id="paging-day"]')
     else:
         return 0
 def get_total_page_in_alarm_detail(self):
     a = self.driver.get_element(
         'x,//*[@id="alarm_info_paging"]').get_attribute('style')
     if a == 'display: block;':
         new_paging = NewPaging(self.driver, self.base_url)
         return new_paging.get_total_page('x,//*[@id="alarm_info_paging"]')
     else:
         return 0
 def get_total_page_in_status(self):
     a = self.driver.get_element(
         'x,//*[@id="paging-offLine"]').get_attribute('style')
     if a == 'display: block;':
         new_paging = NewPaging(self.driver, self.base_url)
         return new_paging.get_total_page('x,//*[@id="paging-offLine"]')
     else:
         return 0
 def get_total_page_in_over_stay_not_shut_down_form(self):
     a = self.driver.get_element(
         'x,//*[@id="paging-stopNotOff"]').get_attribute('style')
     if a == 'display: block;':
         new_paging = NewPaging(self.driver, self.base_url)
         return new_paging.get_total_page('x,//*[@id="paging-stopNotOff"]')
     else:
         return 0
 def get_total_page_in_mile_report_form(self):
     a = self.driver.get_element(
         'x,//*[@id="paging-mileage"]').get_attribute('style')
     if a == 'display: block;':
         new_paging = NewPaging(self.driver, self.base_url)
         total = new_paging.get_total_page('x,//*[@id="paging-mileage"]')
         return total
     else:
         return 0
 def get_total_page_in_tracel_form_with_day(self):
     a = self.driver.get_element('x,//*[@id="paging-day"]').get_attribute(
         'style')
     if a == 'display: block;':
         new_paging = NewPaging(self.driver, self.base_url)
         total = new_paging.get_total_page('x,//*[@id="paging-day"]')
         return total
     else:
         return 0
 def get_page_number_after_search_clock_in_form(self):
     a = self.driver.get_element('x,//*[@id="paging-day"]').get_attribute(
         'style')
     if a == 'display: none;':
         return 0
     else:
         new_page = NewPaging(self.driver, self.base_url)
         number = new_page.get_total_page('x,//*[@id="paging-day"]')
         return number
示例#8
0
 def get_total_page_in_set_up_type(self):
     # 获取总共有多少
     a = self.driver.get_element('x,//*[@id="machineTypeName_paging"]').get_attribute('style')
     if a == 'display: block;':
         new_paging = NewPaging(self.driver, self.base_url)
         number = new_paging.get_total_page('x,//*[@id="machineTypeName_paging"]')
         return number
     elif a == 'display: none;':
         return 0
     self.driver.refresh_browser()
     sleep(3)
示例#9
0
 def click_paging_next_page(self):
     # 如果页数大于1页,先点击下一页
     new_paging = NewPaging(self.driver, self.base_url)
     pages = new_paging.get_total_page(
         'x,//*[@id="pagination-blackCarList"]')
     if pages == 1:
         print("失败,列表页数只有一页,不能点击下一页!")
     else:
         self.driver.click_element(self.NEXT_PAGE_SELECTOR)
         sleep(3)
         check = self.check_click_next_page()
         if check == True:
             print('点击下一页成功!')
         else:
             print('点击下一页失败!')
示例#10
0
 def get_total_number_after_click_search_user_button(self):
     a = self.driver.get_element(
         'x,//*[@id="complex_paging_user"]').get_attribute('style')
     print(a)
     b = self.driver.get_element(
         'x,//*[@id="complex_user_table_nodata"]').get_attribute('style')
     print(b)
     if a == 'display: block;':
         new_paging = NewPaging(self.driver, self.base_url)
         total = new_paging.get_total_page(
             'x,//*[@id="complex_paging_user"]')
         return total
     else:
         if a == 'display: none;' and b == 'display: none;':
             return 0
         elif a == 'display: none;' and b == 'display: block;':
             return 0
 def get_total_page_in_clock(self):
     new_paging = NewPaging(self.driver, self.base_url)
     try:
         return new_paging.get_total_page('x,//*[@id="paging-day"]')
     except:
         return 0
 def get_page_number_in_refill_record_search(self):
     new_paging = NewPaging(self.driver, self.base_url)
     total = new_paging.get_total_page('x,//*[@id="recharge_paging"]')
     return total