def del_policy_n(self, n): #点击页面上强制网络门户 CPControl.CP_menu(self) #点击删除按钮 CPControl.del_button(self, n) #弹出的提示窗口中,点击确认 CPControl.notice_ok(self) CPControl.apply(self)
def del_many_policys(self, start_n, end_n): #点击页面上强制网络门户 CPControl.CP_menu(self) for i in range(start_n, end_n): #点击删除按钮 CPControl.del_button(self, i) #弹出的提示窗口中,点击确认 CPControl.notice_ok(self) CPControl.apply(self)
def check_del_policy_success(self, n, name): #点击页面上强制网络门户 CPControl.CP_menu(self) #点击删除按钮 CPControl.del_button(self, n) CPControl.notice_ok(self) CPControl.apply(self) result = CPControl.get_titlediv(self) if name not in result: return True else: return False
def check_del_policy(self, n): #点击页面上强制网络门户 CPControl.CP_menu(self) #点击删除按钮 CPControl.del_button(self, n) #判断是否会弹出提示框,有则返回True,没有则返回False element1 = self.driver.find_element_by_xpath( ".//div[@class='modal-footer']//button[@class='btn btn-primary']") result1 = element1.is_displayed() try: element2 = self.driver.find_element_by_xpath( ".//div[@class='modal-footer']//button[@class='btn btn-cancel']" ) result2 = True except: result2 = False print result1, result2 return result1, result2