How to do pull to refresh in Android App?

I am doing Android App automation using Appium
i am stuck in pull to refresh in App

@Tanvi922, Refer this link enter link description here. This solution worked for me. Try this…

I tried that but it is throwing error “RemoteWebElement cannot be resolved to a type”

@Tanvi922, Use driver type as Appium, instead of Web driver.

Ya but still i am getting same error

If you are looking for swipe and refresh. You can use another advance methods like driver.swipe();

// get the scroll area on device for swipe

// take any start element in top of screen
int startX = driver.findElement(By.name(“start-element-id”)).getLocation.getX();
int startY = driver.findElement(By.name(“start-element-id”)).getLocation.getY();

// take any bottom element in bottom of screen
int endX = driver.findElement(By.name(“bottom-element-id”)).getLocation.getX();
int endY = driver.findElement(By.name(“bottom-element-id”)).getLocation.getY();

int count= 0
do{
driver.swipe(startX,endX,startY,endY,3000);
count++;
} while (count<3 || driver.findElement(By.id(“someID”)).getText.equals(“Text to be searched”))

this will scroll 4 time. You can also give terminating condition in OR condition
count is important if text is never found then loop will not be infinite…
so it gives a fair chance if text is found with in count times then ok else exit loop