TouchAction action = new TouchAction(((MobileDriver) GetDriver()));
String t1="//XCUIElementTypeButton[@label='"+Next+"']";
MobileElement test3 = (MobileElement) ((AppiumDriver) CL.GetDriver()).findElementByXPath(t1);
int Balance = 0;
if(direction.equalsIgnoreCase("down")){
Balance=183;
action.tap(test3.getLocation().getX(), test3.getLocation().getY()+Balance).perform();
}
else if(direction.equalsIgnoreCase("up")){
Balance=170;
action.tap(304, 600).perform();//use same technique which is using in if loop.
}
String strValue="//XCUIElementTypeOther/XCUIElementTypePickerWheel[1]";
MobileElement Value = (MobileElement) ((AppiumDriver) CL.GetDriver()).findElementByXPath(strValue);
String collectdata=Value.getAttribute("value");
Above code write in function and loop this function until you are getting the required element.