예제 #1
0
    def get_table_content(self, driver, value_num):
        arr = []
        arr1 = []
        try:
            # 按行查询表格的数据,取出的数据是一整行,按空格分隔每一列的数据
            table_tr_list = driver.find_element(*self.table_loc).find_elements(By.TAG_NAME, "tr")
            time.sleep(5)
            for tr in table_tr_list:
                # result = unicode(tr.text, 'GBK').encode('UTF-8')
                arr1 = (tr.text).split(" ")  # 以空格拆分成若干个(个数与列的个数相同)一维列表
                arr.append(arr1)  # 将表格数据组成二维的列表

        except Exception as e:
            print(e)

        # 循环遍历table数据,确定查询数据的位置
        for i in range(len(arr)):
            tip_num = value_num[i]
            for j in range(len(arr[i])):
                print(arr[i][j])
                input_xpath = (By.XPATH, '//*[@id="390dd8f4-8405-4f64-a260-230a0e54b619-non-body"]/tbody/tr[j]/td[i+1]/input')
                BasePage.text_sender(self, input_xpath, tip_num[j])

        time.sleep(5)
예제 #2
0
 def cargo_is_null(self):
      return BasePage.is_null(self, self.cargoType_loc)
예제 #3
0
 def product_is_null(self):
      return BasePage.is_null(self, self.product_loc)
예제 #4
0
 def name_is_null(self):
     return BasePage.is_null(self, self.customerName_loc)
예제 #5
0
 def waybill_is_null(self):
     return BasePage.is_null(self, self.waybillNo_loc)
예제 #6
0
 def save_click(self):
     BasePage.button_click(self, self.save_loc)
예제 #7
0
 def subweight_enter(self, weight):
     BasePage.text_enter(self, self.subweight_loc, weight)
예제 #8
0
 def cus_code_enter(self, cus_code):
     BasePage.text_enter(self, self.customerCode_loc, cus_code)
예제 #9
0
 def remark_write(self, remark):
     BasePage.text_enter(self, self.remark_loc, remark)
예제 #10
0
 def pieces_enter(self, pieces):
     BasePage.text_enter(self, self.pieces_loc, pieces)
예제 #11
0
 def waybill_send(self, waybill):
     BasePage.text_sender(self, self.waybillNo_loc, waybill)
예제 #12
0
 def waybill_enter(self, waybill):
     BasePage.text_enter(self, self.waybillNo_loc, waybill)
예제 #13
0
 def cargotype_select(self, index):
     BasePage.index_select(self, self.cargoType_loc, index)
예제 #14
0
 def product_select(self, index):
     BasePage.index_select(self, self.product_loc, index)
예제 #15
0
 def cus_name_enter(self, cus_name):
     BasePage.text_enter(self, self.customerName_loc, cus_name)
예제 #16
0
 def pieces_is_null(self):
     return BasePage.is_null(self, self.pieces_loc)
예제 #17
0
 def allweight_is_null(self):
     return BasePage.is_null(self, self.allweight_loc)
예제 #18
0
 def subwaybill_enter(self, sub_waybill):
     BasePage.text_enter(self, self.subwaybill_loc, sub_waybill)