Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/performance/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Appium:如何在没有关闭按钮的情况下关闭iOS模式_Appium_Ui Automation_Appium Ios_Python Appium - Fatal编程技术网

Appium:如何在没有关闭按钮的情况下关闭iOS模式

Appium:如何在没有关闭按钮的情况下关闭iOS模式,appium,ui-automation,appium-ios,python-appium,Appium,Ui Automation,Appium Ios,Python Appium,为了测试,我正在尝试自动化iOS应用程序的UI。我无法关闭/解除没有关闭按钮的模式 我正在使用Appium(Python)来自动执行操作,检查器告诉我模式后面的所有其他元素都是可见的:false。。。因此,如果我点击\ u设置打开模式,点击\ u设置关闭模式不起作用 当我点击\u settings关闭模式时,我的代码继续运行,但没有失败,但以下断言失败,因为模式仍然存在 我还尝试了以下6种操作: #1 el = driver.find_element_by_name('Setti

为了测试,我正在尝试自动化iOS应用程序的UI。我无法关闭/解除没有
关闭
按钮的模式

我正在使用Appium(Python)来自动执行操作,检查器告诉我模式后面的所有其他元素都是可见的
:false
。。。因此,如果我
点击\ u设置
打开模式,
点击\ u设置
关闭模式不起作用

当我
点击\u settings
关闭模式时,我的代码继续运行,但没有失败,但以下断言失败,因为模式仍然存在

我还尝试了以下6种操作:

    #1
    el = driver.find_element_by_name('Settings')
    action = TouchAction(driver)
    action.press(el)

    #2
    return TouchAction(driver).press(None, 10, 10).perform()

    #3
    return TouchAction(driver).tap(driver.find_element_by_name('Settings')).perform()

    #4
    return profile_settings().clear()

    #5
    return driver.execute_script("mobile: tap", {'x': 0, 'y': 0})

    #6
    return driver.swipe(0, 0, 10, 10)

有没有人遇到过这样或类似的事情?或者任何我没有尝试过的想法?

@rHenderson-在对
模式执行操作后,尝试添加以下代码

self.driver.press_keycode(10);

除此之外,如果应用程序支持,按back键也可能有助于关闭
模式。

谢谢@prerna pal!但这不起作用:“错误”:“未知方法”,“消息”:“方法尚未实现”您是否也尝试单击android后退按钮?示例代码:driver.pressKeyCode(AndroidKeyCode.BACK);或驱动程序。导航()。返回();