How to swipe specific area until element visible in IOS device using katalon Studio

i have code like this,
def swipeHorizontal(String elementName) {
String targetCell = “//*XCUIElementTypeStaticText[@name=”"+elementName+""]]";
WebElement el = driver.findElement(By.xpath(targetCell));
HashMap<String, String> scrollObject = new HashMap<String, String>();
scrollObject.put(“element”, ((RemoteWebElement)el).getId());
scrollObject.put(“direction”, “right”);
driver.executeScript(“mobile: scrollTo”, scrollObject);
}
but still get error (Cannot invoke method findElement() on null object)
can anyone help me to fix this problem?