Skip to end of metadata
Go to start of metadata

Instead of using 'Swipe' keyword which requires you to pass in coordinates, you can utilize supported backend mobile gestures from Appium. Below is sample custom keyword:

import org.openqa.selenium.JavascriptExecutor
import com.kms.katalon.core.annotation.Keyword
import io.appium.java_client.AppiumDriver	
	def swipeDirection(String direction){
		JavascriptExecutor js = (JavascriptExecutor) getCurrentSessionMobileDriver()
		HashMap<String, String> scrollObject = new HashMap<String, String>()
		scrollObject.put("direction", direction)
		js.executeScript("mobile: swipe", scrollObject)

	def AppiumDriver getCurrentSessionMobileDriver() {
		return MobileDriverFactory.getDriver();
  • No labels