[Java] using observe() in Java code (Selenium here)

Asked by Yograj

I am using selenium with sikuli to handle the flash controls.
I want to use "onAppear" and "onChange" events in selenium for sikuli objects.

I am not able to write the handle code in selenium for the same.
Kindly help.

My scenario:
I want to hit the either of Yes or No link on appearance of the confirmation message using OnAppear event in selenium. Kindly help me out for the same.

Thanks in advance,
Yograj

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

How do you currently integrate Sikuli scripts into the Selenium stuff:
- running Python scripts from command line?
- using the Java API?
- other method?

Revision history for this message
Yograj (yograj-k1) said :
#2

using java API

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

--1. implement SikuliEventObserver

see: http://sikuli.org/doc/java-x/org/sikuli/script/SikuliEventObserver.html

implement the applicable callbacks. You might check the event contents (http://sikuli.org/doc/java-x/org/sikuli/script/SikuliEvent.html) and stop observing.

--2. register an observer with a region

reg.onAppear(img, observer)

(see e.g. http://sikuli.org/doc/java-x/org/sikuli/script/Region.html#void%20onAppear(PSC,org.sikuli.script.SikuliEventObserver))

--3. start observing
use either (your workflow waits)
http://sikuli.org/doc/java-x/org/sikuli/script/Region.html#observe(double)

or (observing in background)
http://sikuli.org/doc/java-x/org/sikuli/script/Region.html#observeInBackground(double)

When running in background observing HAS TO BE stopped in the handler (server callback).

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

Can you help with this problem?

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

To post a message you must log in.