def del_all_button(self):
     try:
         # #取删除键所有的元素
         # elements = self.driver.find_elements_by_class_name("delbutton")
         # i = 0
         # #当i小于所有元素的个数时进行循环
         # while(i<len(tmp)):
         #     #再次取当前页面的删除键的所有元素
         #     inputs = self.driver.find_elements_by_class_name("delbutton")
         #     #点击最后一个删除按钮
         #     inputs[-1].click()
         #     i +=1
         elements = self.driver.find_elements_by_class_name("delbutton")
         for element in elements:
             try:
                 if element.is_enabled():
                     element.click()
                     PublicControl.notice_ok(self)
             except:
                 print "webpage has not found 'title' or 'notice_ok' attribute"
         self.driver.implicitly_wait(20)
     except Exception as e:
         raise Exception(
             "webpage has not found 'del_all_button' element! The reason is %s"
             % e)
Exemple #2
0
 def del_all_button_backup(self,n):
     for i in range (1,n):
         try:
             element = self.driver.find_element_by_id("del_ssid%s"%i)
             element.click()
             PublicControl.notice_ok(self)
         except:
             print "webpage has not found 'title' or 'notice_ok' attribute"
             self.driver.implicitly_wait(20)
Exemple #3
0
 def new_ssid_tips(self):
     time.sleep(3)
     element = self.driver.find_elements_by_css_selector(".modal-header.dialogtitle.modal-title")[1]
     self.driver.implicitly_wait(20)
     if element.is_displayed()== True:
         PublicControl.notice_ok(self)
         return True
     else:
         print "webpage has not found mesh ssid error tips"
         return False
 def del_all_button(self):
     try:
         elements = self.driver.find_elements_by_css_selector(".delbutton")
         for element in elements:
             element.click()
             PublicControl.notice_ok(self)
             self.driver.implicitly_wait(60)
     except Exception as e:
         raise Exception(
             "webpage has not found 'del_all_button' element! The reason is %s"
             % e)
Exemple #5
0
 def del_all_button(self):
     try:
         elements = self.driver.find_elements_by_class_name("delbutton")
         for element in elements:
             try:
                 if (u"删除" or "Delete") == element.get_attribute("title"):
                     element.click()
                     PublicControl.notice_ok(self)
             except:
                 print "webpage has not found 'title' or 'notice_ok' attribute"
         self.driver.implicitly_wait(20)
     except Exception as e:
         raise Exception(
             "webpage has not found 'del_all_button' element! The reason is %s"
             % e)
Exemple #6
0
 def del_all_button(self):
     try:
         time.sleep(3)
         elements = self.driver.find_elements_by_class_name("delbutton")
         for i in range(len(elements)-1):
             time.sleep(5)
             elements1 = self.driver.find_elements_by_class_name("delbutton")
             elements1[1].click()
             PublicControl.notice_ok(self)
         self.driver.implicitly_wait(20)
     except Exception as e:
         current_time = time.strftime('%m%d%H%M',time.localtime(time.time()))
         png = "error_del_ssid_button_%s.png"%str(current_time)
         self.driver.get_screenshot_as_file("./data/testresultdata/"+png)
         raise Exception("webpage has not found 'del_all_button' element! The reason is %s"%e)
 def del_bandwidth_rule_button(self):
     try:
         time.sleep(3)
         elements = self.driver.find_elements_by_class_name("delbutton")
         for element in elements:
             try:
                 if element.is_enabled():
                     element.click()
                     PublicControl.notice_ok(self)
             except:
                 print "webpage has not found 'title' or 'notice_ok' attribute"
         self.driver.implicitly_wait(20)
     except Exception as e:
         raise Exception(
             "webpage has not found 'del_bandwidth_rule_button' element! The reason is %s"
             % e)