我试图使用appium和以下代码打开控制中心:
int halfWidth = driver.manage().window().getSize().width / 2;
int screenHeight = driver.manage().window().getSize().height;
driver.swipe(halfWidth, screenHeight-5, halfWidth, screenHeight-300, 500); // driver is instance of IOSDriver而不是打开控制中心,这个应用程序只是从底部向上画屏幕(使用坐标输入)。谁知道如何打开控制中心使用appium和滑动(或任何其他方式)?
谢谢,查理
发布于 2015-07-07 21:31:10
好吧,经过大量的调查,我觉得这是不可能的。如果你真的需要这个功能,那么我认为像茄子这样的工具可能是合适的。
发布于 2016-02-01 06:59:30
我们可以做到的。我尝试在Appium 1.4.13,我可以改变设置。
我使用下面的代码来更改我的iPadAir2中的设置。
int height = driver.findElementByClassName("UIAWindow").getSize().getHeight();
int width = driver.findElementByClassName("UIAWindow").getSize().getWidth();
driver.swipe(width-100, height, width-100, height-200, 500);
driver.findElementByAccessibilityId("Wi-Fi").click();发布于 2017-10-25 15:31:01
Appium 1.6.5,您可以使用swipe方法,下面是我的Python代码:
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() https://stackoverflow.com/questions/30913784
复制相似问题