Selenium and Java - -> In depth

Asked by Guru

Hey people,

Raiman does a great work, apprecaition to him!

But would be more great if anyone could say me this!

Using Java/Selenium how can i do the below:
i. Verify an image exists or not
ii. If Yes is it in the rite place (x,y) (will this be affected form moniter to moniter or dependencies)
iii. Is that the right image (compared from file).

Moreover can this interact internally with image on the browser opened by selenium.
Presently i had to programmatically make the selenium browser to be available (active) on the window for SIKULI interaction.

Thanks in advance!

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
RaiMan (raimund-hocke) said :
#1

1. What can be found by Sikuli has to be visible on the screen.

2. You can use exists() to check for the presence, no exception FindFailed, only False is returned. If image is present, the match object is returned. This contains the coordinates.

Here you will find the javadoc for all classes, that are directly available when running sikuli script from inside java:
http://sikuli.org/doc/java.

With your other question, we learned that you have to create a new screen object, that will be used as the region to find images (to be "translated" into java ;-)
scr = <a new screen object>
m = scr.exists(<image>)
# m is either False or contains a ref to a match object.

Tip: try your workflow using the IDE and then convert it to java.

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

I set this to answered.

Can you help with this problem?

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

To post a message you must log in.