几天前我开始学习appium。以下是我的设想:
下面是我为上述场景实现的代码:
driver.findElement(By.className(properties.getProperty("home_menu_className"))).click();
System.out.println("clicked on home menu");
driver.findElement(By.className(properties.getProperty("home_menu_className"))).click();
WebElement mobile = driver.scrollTo("Mobiles");
System.out.println("scroll till Mobiles in home slider menu");
mobile.click();
driver.scrollTo("Top Offers!!").click();
driver.scrollTo("Honor 4x").click();
delay(4000);
WebElement honor = driver.findElementById("com.flipkart.android:id/product_list_product_item_image");
taction.tap(honor);
driver.swipe(495,484, 52, 484, 12000);
delay(12000);
driver.zoom(164, 644);
delay(8000);当我运行上面的代码时,显示x轴和y轴在同一个页面上的滑动动作,从右边到left.And,它不会在图像之间滑动,也不会缩放。
有人能告诉我具体的方法吗?
提前谢谢。
发布于 2015-10-16 13:29:32
尝试使用TouchAction类来执行扫描功能。
TouchAction action = new TouchAction(driver).longPress(x,y).moveTo(x, y).release();
action.perform();https://stackoverflow.com/questions/33163248
复制相似问题