Exemplo n.º 1
0
    def tab_list_delete_row(self,num):
        '''选项卡点击列表删除类型的操作按钮'''
        '''删除记录数,1或者当前显示数'''
        checkboxs = self.click_tab_list_rows()
        print("checkboxs=====%s"%checkboxs)
        if checkboxs:
            if num == 1:
                checkboxs[0].click()
 
            else:
                 for checkbox in checkboxs:
                     checkbox.click() 
                   
                      
            bp = ButtonPage(self.driver)
            bp.click_tab_list_button(bp.del_btn)
            #time.sleep(0.5)
            self.click_alert_dismiss()
            #time.sleep(0.5)
            bp.wait_loading_hide()
            bp.click_tab_list_button(bp.del_btn)
            #time.sleep(0.5)
            tismsg = self.get_alert_text() 
            self.click_alert_accept()
            self.wait_loading_hide()
            #time.sleep(0.5)
            return tismsg
Exemplo n.º 2
0
    def tab_list_add_row(self):
        btn = ButtonPage(self.driver)
        btn_title = btn.get_tab_list_button(btn.new_btn).get_attribute('title')

        #点击新建按钮
        btn.click_tab_list_button(btn.new_btn)
        #time.sleep(0.5)
        #切换到弹出层打开的页面
        mp = MainPage(self.driver)        
        mp.switch_to_div_iframe()
        #time.sleep(0.5)
        btn_title = btn.get_button_title(btn.save)
        btn.click_button(btn.save)
        btn.wait_loading_hide()
        return btn_title