We are trying to automate a scenario where we need to perform scroll operation, but swipe & JavaScriptExecutor is not working, a little background to our problem, the application under test is a hybrid application (both native & webview are available) and we are using IOS_Webkit_Debug_Proxy to enable web_view. (We are not using native elements as our application is total built on webview)
Tried couple of ways like switching web_view to native and vice versa but in both the cases driver.swipe method or scroll application using JavaScript Executor is not working.
Desired Capabilities:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, configuration.getProperty(MobileCapabilityType.PLATFORM_NAME));
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, configuration.getProperty(MobileCapabilityType.PLATFORM_VERSION));
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, configuration.getProperty(MobileCapabilityType.DEVICE_NAME));
capabilities.setCapability(MobileCapabilityType.UDID, configuration.getProperty(Constants.UDID));
capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT,8000);
capabilities.setCapability(MobileCapabilityType.APP, System.getProperty(“user.dir”) + configuration.getProperty(Constants.APP_IOS));
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.IOS_XCUI_TEST);
capabilities.setCapability(MobileCapabilityType.AUTO_WEBVIEW, true);
capabilities.setCapability(“autoAcceptAlerts”, true);
String urlString = new StringBuffer(configuration.getProperty(Constants.PROTOCOL))
.append("://").append(configuration.getProperty(Constants.HOST_NAME))
.append(":").append(configuration.getProperty(Constants.PORT))
.append("/wd/hub").toString();
driver = new IOSDriver(new URL(urlString), capabilities);
driver.manage().timeouts().implicitlyWait(Constants.TIMEOUT_IN_SECONDS, TimeUnit.SECONDS);
JavaClient: 4.1.2
Appium: 1.6.4
IOS_Webkit_Debug_Proxy
IOS version: 10.2
xCode: 8.3.2
Physical Device
Let me know if you require more details and we are in the middle of the project we need solution or workaround to get going.