【发布时间】:2017-01-16 15:38:46
【问题描述】:
我正在使用 appium 和 java 来自动化我的测试。 我想知道我用黄色圈起来的按钮的名称。 如何通过点击带有黄色圆圈的按钮来隐藏键盘?
HERE the link for another question, but still have the same problem
【问题讨论】:
标签: ios keyboard testng appium appium-ios
我正在使用 appium 和 java 来自动化我的测试。 我想知道我用黄色圈起来的按钮的名称。 如何通过点击带有黄色圆圈的按钮来隐藏键盘?
HERE the link for another question, but still have the same problem
【问题讨论】:
标签: ios keyboard testng appium appium-ios
你可以尝试使用吗:
driver.hideKeyboard("Hide keyboard");
【讨论】:
driver.hideKeyboard();
【讨论】:
driver.hideKeyboard(); 而第二个解决方案必须起作用,但不幸的是,我没有在占位符中点击另一个字符(额外的'z')而不是关闭键盘! !
hideKeyboard() 不接受字符串,您可能使用的是旧版本的 java 客户端。最新版本是 4.1.1。否则它可能与您正在使用的驱动程序有关。你在使用AppiumDriver driver = new IOSDriver(url, caps); 吗?
AppiumDriver:AppiumDriver<WebElement>(new URL("http://0.0.0.0:4723/wd/hub"),capabilities)
hideKeyboard() 接受字符串实际上是 IOSDriver 特定的:appium.github.io/java-client/io/appium/java_client/ios/… 所以你需要将 AppiumDriver 转换为 IOSDriver 才能访问该命令。否则你应该仍然可以尝试找出一个运行良好的 findElement 命令和按钮上的click()。