String elementId = payload.optString("element");
if (!payload.isNull("element") && !elementId.equals("")) {
Point offset = new Point(payload.getInt("xoffset"), payload.getInt("yoffset"));
double speed = payload.optDouble("speed", 1.0);
if (RemoteIOSWebDriver.isPlainElement(elementId)) {
NodeId nodeId = RemoteIOSWebDriver.plainNodeId(elementId);
plainFlickFromElement(request, screenSize, offset, speed, nodeId.getId());
} else {
nativeFlickFromElement(request, screenSize, offset, speed, elementId);
}
} else {
double speedX = payload.optDouble("xspeed", 1.0);