Drag and drop issue with Mac

Asked by vivek

Hi,

Previously I was using Mac OS version 10.10.2 and java version 1.6.x. sikuli version 1.1.0,By that time Drag and drop works fine.

After updating my OS version to 10.12.5 & java version to 1.8.0.131 Only mouse is getting moved across the source and destination images the object to be dragged is not moved from source to destination.

when downgraded java version to 1.6 it is working fine.

using MarathonITE tool for my automation,Drag & drop option is not working in that so we integrated sikuli with MarathonITE.

Please help in resolving this.

Have tried the following methods
Method 1
screen = org.sikuli.script.Screen.new
        screen.hover($imagepath+"/Blue.png")
        sleep(1)
        screen.mouseDown(Button.LEFT)
        sleep(1)
        screen.mouseMove($imagepath+"/workarea.png")
        sleep(1)
        screen.mouseUp()

Method2:
screen = org.sikuli.script.Screen.new
screen.dragDrop($imagepath+"/Blue.png", $imagepath+"/workarea.png")

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
vivek (vivekmanoharan) said :
#1

Hi,

Any update on this Issue.

Revision history for this message
RaiMan (raimund-hocke) said :
#2

Just checked in same environment:

switchApp("Safari")
pFrom = "pfrom.png"
hover(pFrom)
mFrom = getLastMatch()
rTo = mFrom.offset(200, 200)
dragDrop(pFrom, rTo)
wait(2)
rFrom = Mouse.at()
mouseDown(Button.LEFT)
mouseMove(mFrom)
mouseUp()
wait(2)

works as expected and moves the Safari window forth and back

Revision history for this message
RaiMan (raimund-hocke) said :
#3

ok, I used SikuliX 1.1.1 (but should not make a difference)

Revision history for this message
vivek (vivekmanoharan) said :
#4

It is not working!!!

I am not using sikuli completely for my testing,It is integrated with another tool called MArathonITE,So I am getting error in switchApp & getLastMatch operations.

could you please help in setting up Sikuli IDE in Mac version 10.12.5. Because I have downloaded Sikulixsetup-1.1.1.jar and placed it in a new folder called SikuliX

Executed it through Command Line getting the following error

Exception in thread "main" java.lang.NoSuchMethodError: org.sikuli.basics.Debug.logx(ILjava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
 at org.sikuli.script.RunTime.log(RunTime.java:96)
 at org.sikuli.script.RunTime.loadOptions(RunTime.java:1273)
 at org.sikuli.script.RunTime.get(RunTime.java:282)
 at org.sikuli.setup.RunSetup.main(RunSetup.java:168)

Revision history for this message
vivek (vivekmanoharan) said :
#5

t is not working!!!

I am not using sikuli completely for my testing,It is integrated with another tool called MArathonITE,So I am getting error in switchApp & getLastMatch operations.

could you please help in setting up Sikuli IDE in Mac version 10.12.5. Because I have downloaded Sikulixsetup-1.1.1.jar and placed it in a new folder called SikuliX

Executed it through Command Line getting the following error

Exception in thread "main" java.lang.NoSuchMethodError: org.sikuli.basics.Debug.logx(ILjava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
 at org.sikuli.script.RunTime.log(RunTime.java:96)
 at org.sikuli.script.RunTime.loadOptions(RunTime.java:1273)
 at org.sikuli.script.RunTime.get(RunTime.java:282)
 at org.sikuli.setup.RunSetup.main(RunSetup.java:168)

Revision history for this message
RaiMan (raimund-hocke) said :
#6

Just checked the SikuliX 1.1.1 IDE setup with my macOS 10.12.5 and latest Java 8: works.

So it is some environment issues, that you might have in your MarathonITE situation.

steps to do:
1. delete the directory ~/Library/Application Support/Sikulix and rerun setup, by simply double-clicking the file setup....jar in the Finder
2. if this does not work: in a Terminal check your actual environment about settings like CLASSPATH and other Java related settings, that might influence what is running and what is referenced
3. if you have a chance, to check on a Mac, that is not contaminated by MarathonITE: good idea to check there.

I cannot help you with your situation, if it is a problem caused by MarathonITE: I simply do not know it and do not want to, sorry.

Revision history for this message
vivek (vivekmanoharan) said :
#7

Is it possible to make sikuli to use only java 6 incase if we have both java 8 & java 6 installed in one machine.

Revision history for this message
RaiMan (raimund-hocke) said :
#8

yes is possible (but only up to SikuliX 1.1.0, since 1.1.1+ need 1.7/1.8)

in a Terminal:
/usr/libexec/java_home -V

... will show your installed Java versions

export JAVA_HOME=`/usr/libexec/java_home -v 1.6`

... should switch the Java version for this Terminal session to version 6

control via
java -version

... should now show that version 6 is running

now run your stuff in this Terminal session

Revision history for this message
Ashok kumar (ashok14) said :
#9

Hi Vivek,

Are you able to find the button or search box by using image in mac? I am getting FindFailed exception.

Hoping for a quick response.

Thanks

Revision history for this message
vivek (vivekmanoharan) said :
#10

Hi Ashok,

I am able to find buttons, Unfortunately finding any textboxes is not required in any of my scenarios.

Do you have any idea about drag and drop with java 8 and sikuli.

Regards,
Vviek

Revision history for this message
Ashok kumar (ashok14) said :
#11

Hi Vivek,

Try with Region.dragdrop with Sikulix. I have not tried though, but I've just seen glimpses of such methods in sikuliX.
Thanks,
Ashok.

Can you help with this problem?

Provide an answer of your own, or ask vivek for more information if necessary.

To post a message you must log in.