Re: [Sikuli-driver] [Question #665279]: [HowTo] node-java : Using SikuliX features through API --- tipps and tricks

2018-03-30 Thread RaiMan
Question #665279 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/665279

RaiMan proposed the following answer:
Ok, what you can do:
simply use the plain Java AWT Robot class yourself in your clickSynch wrapper 
and try to click ;-)

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #665279]: [HowTo] node-java : Using SikuliX features through API --- tipps and tricks

2018-03-30 Thread RaiMan
Question #665279 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/665279

Status: Open => Answered

RaiMan proposed the following answer:
Ok, I have to stop here: I cannot help you: too many dimensions of
complexity.

Tracking my situation back (some month ago ;-), I have to admit, that I
do not have any testcase, where the click() feature was run on travis.

This is what I do there on an Ubuntu system:

language: java
jdk: oraclejdk9
install: mvn install -P build-fat -DskipTests=true -B
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 5
script:
 - mvn test -B

I will try to setup a testcase, that clicks and tries to proceed the
next week.

And I will add debug level 4 messages to the click feature and add an
option to switch those on/off.

Sorry, that I have to let you alone for now.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #665279]: [HowTo] node-java : Using SikuliX features through API --- tipps and tricks

2018-03-30 Thread Finn Ellis
Question #665279 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/665279

Status: Answered => Open

Finn Ellis is still having a problem:
Oh yes, it's definitely running -- I've defined a screen, and can
confirm with screenshots that a graphical session has started and is
running the applications it's supposed to be running. Even if I didn't
have screenshots, Sikuli itself is reporting (in the excerpt above) that
it does see the image it's looking for. The only problem (so far) is
right there in between those two console.log() lines, where it gets
stuck in the click() call and never gets back out. Specifically, it
gives me the log output above, then nothing else for ten minutes, at
which point the build job times out. Locally, when it gets to this
point, it clicks where it's supposed to and continues as expected.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #665279]: [HowTo] node-java : Using SikuliX features through API --- tipps and tricks

2018-03-30 Thread RaiMan
Question #665279 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/665279

Status: Open => Answered

RaiMan proposed the following answer:
It seems to run on TravisCI: do you have a screen defined?

I use for that:
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 5

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #665279]: [HowTo] node-java : Using SikuliX features through API --- tipps and tricks

2018-03-29 Thread Finn Ellis
Question #665279 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/665279

Status: Solved => Open

Finn Ellis is still having a problem:
I've got another question for you -- I'm keeping it here for now since
it's part of the same weird setup, but happy to start another thread if
that would make more sense.

I have a script now (still using the Java API + node-java bridge) which
runs fine locally but is hanging in CI, seemingly somewhere inside
Mouse.click. I'm not sure what exactly the relevant environment
difference is, but here's what I'm seeing.

The relevant bit of node code is as follows (where this.waitForImage is
just a wrapper around screen.Wait which knows some things about where
images are).

  console.log(`Attempting to paste '${text}' into the '${imageName}' 
field`);
  const field = await this.waitForImage(imageName);
  console.log(`Clicking into ${imageName} ...`);
  this.screen.clickSync(field);
  console.log(`Pasting into ${imageName} ...`);
  this.screen.pasteSync(field, text);

The output, with debug level 3, is:

Attempting to paste '[redacted]' into the 'slack-placeholder-workspace' field
Waiting for image: slack-placeholder-workspace
[debug] Image: loaded: 
/Users/travis/build/tinyspeck/slack-desktop/spec/e2e/images/slack-placeholder-workspace.png
 
(file:/Users/travis/build/tinyspeck/slack-desktop/spec/e2e/images/slack-placeholder-workspace.png)
[debug] Image: cached: 
/Users/travis/build/tinyspeck/slack-desktop/spec/e2e/images/slack-placeholder-workspace.png
 (25 KB) (# 1 KB 25 -- 0 % of 64 MB)
[debug] Region: wait: waiting 60.0 secs for 
/Users/travis/build/tinyspeck/slack-desktop/spec/e2e/images/slack-placeholder-workspace.png
 to appear in S(0)[0,0 1024x768]
[debug] Region: wait: 
/Users/travis/build/tinyspeck/slack-desktop/spec/e2e/images/slack-placeholder-workspace.png
 appeared (M[415,279 175x38]@S(S(0)[0,0 1024x768]) S:0.94 C:502,298 [2641 msec])
Found image: slack-placeholder-workspace
Clicking into slack-placeholder-workspace ...
[debug] Region: init: (0, 0, 5, 5)

So it's finding the image and trying to click on it, but gets stuck
trying and never gets as far as the paste call. I poked through the code
and didn't find anything obvious, other than the fact that it's stopping
somewhere before another debug statement.

I noticed in the changelog that the nightly build from a couple of days
ago had some version detection improvements, so I tried that, but no
luck.

Any other ideas, or any other information I can get for you?

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #665279]: [HowTo] node-java : Using SikuliX features through API --- tipps and tricks

2018-03-16 Thread RaiMan
Question #665279 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/665279

RaiMan posted a new comment:
Every information you contribute is always welcome.

I have changed the question a little bit so it is more generic.

You might add comments here for questions and needed enhancements in
SikuliX.

Tipps and tricks should be added to the question itself (see my
example).

Feel free, to do it as you like - if I have any improvements I will
tell.

--- highlight and built-in image-capturing mechanism might also fail
... I guess you are talking about the interactive capture feature 
(Screen.userCapture() and Screen.selectRegion())

the problem here might be again some threading issue (or even Java EventQueue).
Both features internally work with a screen overlay frame, that has handlers 
attached for keyboard/mouse actions.
This can only be evaluated with extensive debugging with the source code.

Since I am not sure about the overall value of node-java, I did not step
into it until now.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #665279]: [HowTo] node-java : Using SikuliX features through API --- tipps and tricks

2018-03-16 Thread RaiMan
Question #665279 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/665279

Summary changed to:
[HowTo] node-java : Using SikuliX features through API --- tipps and tricks

Description changed to:
 Mac: Instantiating SikuliX class hangs: solution (from 
comment #12)
Adding:

process.env['JAVA_STARTED_ON_FIRST_THREAD_' + process.pid] = '1'

before instantiating any Sikuli classes through node got it working. :)

--

I'm using the node-java module (https://github.com/joeferner/node-java)
as a bridge between some nodejs test scripts and the SikuliX Java API.
It's working great on Windows, but when I try to run the same scripts on
Mac, it hangs at the first point where it tries to instantiate any class
from SikuliX. Specifically, it opens up a little GUI app whose label is
just "bin" and which has no windows; command-clicking to see its
location takes me to /usr/local/bin (which raises more questions than it
answers). When I force quit the app, the script doesn't resume, it just
ends.

Using the API and the command line tool work fine (although of course
they're not compatible with my Node scripts) -- and using node-java with
any other Java package on Mac also works fine. So neither one is broken
alone, and I'm not sure what about the combination causes this error. I
realize how much of an edge case this is, but any suggestions about what
might be going on or where I could look would be much appreciated.

I've tried SikuliX 1.1.1 and 1.1.2, in both cases by completing the
setup normally (taking options #1 and #2) and then copying the generated
sikulixapi.jar into the folder I'm working in. Java JDK version is
1.8.0, macOS 10.13.3.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp