繁体   English   中英

如何通过Selenium,appium,java和android以更快的方式多次点击元素

[英]How to tap on an element multiple times in a faster way through selenium, appium, java and android

我想自动化使用selenium,java,appium和android的场景,以更快的方式多次点击一个元素,然后出现一个按钮,我已经尝试使用Java代码,使用for循环与硒webdriver click / appium touchactions tap,但没有任何帮助我。

如果要对元素执行多次点击。

使用以下代码:

WebElement element=driver.findElement(By.id("someID"));

TouchAction actionOne = new TouchAction();
actionOne.tap(element);
actionOne.release();

TouchAction actionTwo = new TouchAction();
actionTwo.tap(element);
actionTwo.release();

MultiTouchAction action = new MultiTouchAction();
action.add(actionOne);
action.add(actionTwo);
action.perform();

如果需要两个以上,请添加尽可能多的水龙头。 这应该工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM