swipe actions in native apps using Appium-android -


i started learning appium few days back. well, question want swipe images in flipkart app , zoom image. have tried using below code , swipe action has been performed on same page i.e.,on same image moved right left x-axis , y-axis lines, zoom action has not been performed. can tell me please java code on how swipe images , zoom it.

below code :

driver.findelement(by.classname(properties.getproperty("cross_mark_classname"))).click();     system.out.println("clicked on cross mark");     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(honor);  delay(8000); 

you can try perform swipe using touchaction class.

 touchaction action = new touchaction(driver).longpress(x,y).moveto(x, y).release();  action.perform(); 

Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -