How to scrollIntoView via Javascript executor for iOS devices

@Aleksei I want to use scrollIntoView methodfor a particular mobile element on iOS device via Javascript executor on Appium 2.0. Is it possible to do so?? And if it is, may I get the syntax please??

possibly you looking for

Hi Aleksei, I did try to scroll in that specific element in iOS device via appium 2.0 but getting the below error:

final HashMap<String, String> scrollObject = new HashMap<>();
scrollObject.put(“direction”, “up”);
scrollObject.put(“name”, “xyz”); [Giving in the accesibilityId as xyz]

    getMobileDriver().executeScript("mobile:scroll", scrollObject);

org.openqa.selenium.InvalidElementStateException: Error Domain=com.facebook.WebDriverAgent Code=1 “Failed to find scrollable visible parent with 2 visible children” UserInfo={NSLocalizedDescription=Failed to find scrollable visible parent with 2 visible children}
Build info: version: ‘4.13.0’, revision: ‘ba948ece5b*’
System info: ‘Windows Server 2016’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘17.0.11’
Driver info: io.appium.java_client.ios.IOSDriver
Command: [61f59e73-1dc9-4c83-8a09-8c999bc3203d, executeScript {script=mobile:scroll, args=[{name=xyz, direction=up}]}]

@anuresh_nanda you can try this one:

public  void swipeGesture(AppiumDriver driver,WebElement element)
            element =driver.findElement(AppiumBy.accessibilityId(accessibilityId));
            Map<String, Object> params = new HashMap<>();
            params.put("element",((RemoteWebElement) element).getId());
            driver.executeScript("mobile: scroll",params);