SHARE
TWEET

Untitled

a guest Jun 24th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package aCustomDragmDrop
  2. import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
  3. import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
  4. import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
  5. import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
  6.  
  7. import com.kms.katalon.core.annotation.Keyword
  8. import com.kms.katalon.core.checkpoint.Checkpoint
  9. import com.kms.katalon.core.checkpoint.CheckpointFactory
  10. import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords
  11. import com.kms.katalon.core.model.FailureHandling
  12. import com.kms.katalon.core.testcase.TestCase
  13. import com.kms.katalon.core.testcase.TestCaseFactory
  14. import com.kms.katalon.core.testdata.TestData
  15. import com.kms.katalon.core.testdata.TestDataFactory
  16. import com.kms.katalon.core.testobject.ObjectRepository
  17. import com.kms.katalon.core.testobject.TestObject
  18. import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords
  19. import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords
  20.  
  21. import internal.GlobalVariable
  22.  
  23. import MobileBuiltInKeywords as Mobile
  24. import WSBuiltInKeywords as WS
  25. import WebUiBuiltInKeywords as WebUI
  26.  
  27. import org.openqa.selenium.WebElement
  28. import org.openqa.selenium.WebDriver
  29. import org.openqa.selenium.By
  30.  
  31. import com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory
  32. import com.kms.katalon.core.webui.driver.DriverFactory
  33.  
  34. import com.kms.katalon.core.testobject.RequestObject
  35. import com.kms.katalon.core.testobject.ResponseObject
  36. import com.kms.katalon.core.testobject.ConditionType
  37. import com.kms.katalon.core.testobject.TestObjectProperty
  38.  
  39. import com.kms.katalon.core.mobile.helper.MobileElementCommonHelper
  40. import com.kms.katalon.core.util.KeywordUtil
  41.  
  42. import com.kms.katalon.core.webui.exception.WebElementNotFoundException
  43.  
  44. import io.appium.java_client.AppiumDriver
  45. import io.appium.java_client.MobileElement
  46. import io.appium.java_client.TouchAction
  47.  
  48. public class DragDrop {
  49.  
  50.     @Keyword
  51.     def dragdrop(TestObject to,TestObject destination,Integer intX,Integer intY) {
  52.     def Eleto = MobileElementCommonHelper.findElement(to, timout)
  53.     def eledest = MobileElementCommonHelper.findElement(destination, timeout)  
  54.     TouchAction touchAction = new TouchAction(driver)
  55.     touchAction.moveToElement(eleto)
  56.     touchAction.waitAction(WaitOptions.waitOptions(Duration.ofMillis(2000)))
  57.     touchAction.perform()
  58.     touchAction.moveToElement(eledest,intX, intY)
  59.     touchAction.release()
  60.     touchAction.perform();
  61. }
  62. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top