Can anyone please tell me how to perform auto refresh on android app using appium

Hi Team

  • Platform is Android
  • Appium version : 1.5
  • Emulator/Simulator or Real Device : Real Device
  • Client langauage (language binding) : java
  • OS : Windows

I have a scenario where i need to to perform an auto refresh by pulling up the app which is when the loader comes and updates the feeds.

  1. Open app
  2. Capture the photo
  3. Post the image which has been captured
  4. Goto the feed screen
  5. Now on this screen i need to pull the app so that the auto refresh loader comes and updates the feeds with the new data.

If someone is able to do it can please reply me for the step 5

according to your description app must itself refresh feeds.

how you imaging we can force app to refresh screen?

if your app will refresh screen on resume try:

try{driver.runAppInBackground(1);} catch (Exception e) {}

Actually once you have successfully posted the image then you need to go to feed screen and pull the screen from up to down so that you can get the latest feeds which you have posted.

so do swipe from up do down

Ok Can you please give the swipe code how to implement it.
I need to swipe from app starting so that loader will come and feed screen will get refreshed

driver.swipe(startx, starty, endx, endy, duration)

Hi Aleksei

thanks for your help i am attaching herein the screenshot of the app where I have highlighted the app from where we need to hold and swipe can you please tell what would be its co-ordinates just by giving me an example
i have highlighted the co-ordinates in red color,

try: driver.swipe(1080/2, 322+5, 1080/2, 1192-5, 1000)

Thanks Aleksei it worked out, Thanks for the help

It’s not worked for me, I applied the above solution on Google Pixel, but it fails the problem I am facing is that when the android screen load completely after the service request complete we are not getting the element from the screen, for that reason we tried to refresh the screen, spent my complete day, but fails, pleas help.