imports:
import org.sikuli.script.*
import com.kms.katalon.core.util.KeywordUtil
custom keyword:
@Keyword
def dragDropByImage(String s1,String s2){
Screen s = new Screen()
String path = new File('.').getCanonicalPath()
String imgPath1=path+s1
String imgPath2=path+s2
Pattern pt1 = new Pattern(imgPath1)
Pattern pt2 = new Pattern(imgPath2)
if (pt1 == null || pt2==null) {
throw new FindFailed('image not found')
} else {
s.dragDrop(pt1, pt2)
KeywordUtil.markPassed("image clicked successfully")
}
}
This keyword was working on the previous version of the Katalon studio which was 8.4 but since I updated it to the version 8.5.1, it is showing the below error. please suggest a solution for this!
this is the script step i have used:
CustomKeywords.‘com.keywords.dragDropByImage’(“//Screenshots//Targets//Thematic Map//Scroll key press USA.png”,“//Screenshots//Targets//Thematic Map//south africa drop.png”)
When I try to run the script by using this custom keyword it is showing the following error:
java.lang.NoSuchMethodError: com.sun.jna.Native.load(Ljava/lang/String;Ljava/lang/Class;Ljava/util/Map;)Lcom/sun/jna/Library;