Ejemplo n.º 1
0
 def test_click(self):
     self.driver.get("http://sahitest.com/demo/clicks.htm")
     element_click = self.driver.find_element_by_xpath(
         "//input[@value = 'click me']")
     element_duble_click = self.driver.find_element_by_xpath(
         "//input[@value = 'dbl click me']")
     element_dright_click = self.driver.find_element_by_xpath(
         "//input[@value = 'right click me']")
     action = ActionChains(self.driver)
     action.click(element_click)
     action.double_click(element_duble_click)
     action.context_click(element_dright_click)
     action.perform()
Ejemplo n.º 2
0
    def test_case_click(self):
        self.driver.get("http://sahitest.com/demo/clicks.htm")
        #双击
        dbl_click_element = self.driver.find_element(
            By.XPATH, '//input[@value="dbl click me"]')

        #单机
        click_element = self.driver.find_element(By.XPATH,
                                                 '//input[@value="click me"]')

        #右击
        right_click_element = self.driver.find_element(
            By.XPATH, '//input[@value="right click me"]')
        action = ActionChains(self.driver)
        #鼠标单击
        action.click(click_element)
        #鼠标双击
        action.double_click(dbl_click_element)
        #鼠标右击
        action.context_click(right_click_element)
        sleep(3)
        action.perform()
        sleep(3)
Ejemplo n.º 3
0
 def jump(self, x, y):
     action.click(x, y)
Ejemplo n.º 4
0
 def click(self, x, y):
     action.click(x, y)
Ejemplo n.º 5
0
 def sign_in(self):
     action.click(self.sigin_x, self.sigin_y, 3)
Ejemplo n.º 6
0
 def click_sign(self):
     action.click(self.sign_btn_x, self.sign_btn_y)
Ejemplo n.º 7
0
 def click_my(self):
     action.click(self.my_x, self.my_y)