Access iOS Control Center using appium

后端 未结 7 1830
一整个雨季
一整个雨季 2021-01-01 23:48

I am trying to open the Control Center using appium and the following code:

    int halfWidth = driver.manage().window().getSize().width / 2;
    int screenH         


        
7条回答
  •  难免孤独
    2021-01-02 00:04

    Appium 1.6.5, You can use swipe method, bellow my Python code:

    window_size = self.driver.get_window_size()  # this returns dictionary
    el = self.driver.find_element(*self.configuration.CommonScreen.WEB_VIEW)
    action = TouchAction(self.driver)
    start_x = window_size["width"] * 0.5
    start_y = window_size["height"]
    end_x = window_size["width"] * 0.5
    end_y = window_size["height"] * 0.5
    action.press(el, start_x, start_y).wait(100).move_to(el, end_x, end_y).release().perform() 
    

提交回复
热议问题