how to identify an image,everytime, until match found from the set of images

Asked by Kathyayani

Am trying to write a program on selenium IDE(Java) using Sikuli class methods

where, when an alert [captured as .png image] came then, I want to check the set of .png images till the alert image is matched.

Note: Here, already checked images also needs to check, as the alert image can also be in previous checked images

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

I am not aware, that there is a valid combination of Selenium IDE and Java programming.

So if you want to use SikuliX, first get some knowledge about it's features using the SikuliX IDE.
http://sikulix.com

The rest is programming knowledge.

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

Just changing the question a bit, does not make it clearer.

Not sure what you are doing:
How do you want to access SikuliX Java classes from the Selenium IDE?

again comment #1:
So if you want to use SikuliX, first get some knowledge about it's features using the SikuliX IDE.
http://sikulix.com

The rest is programming knowledge.

Revision history for this message
Kathyayani (kathyayani) said :
#3

Thanks RaiMan, for your swift look..

Here, i tried to write a script on window based application using Sikulix, to prevent manual intervention

So I automated it completely but the application pop ups order is not always in same order.. due to this, i need to update my script again and again..

So, am trying automate this step like, when an alert [captured as .png image] came then, I want to check the set of .png images till the alert image is matched.

Not sure whether to automate this step is possible or not but trying..

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

If I understand right, then you currently have a simple script like this

wait(popup1)
click(popup1)
wait(popup2)
click(popup2)
wait(popup3)
click(popup3)
...

but the next time you might need this:

wait(popup3)
click(popup3)
wait(popup1)
click(popup1)
wait(popup2)
click(popup2)
...

if you want to make this "self-adjusting", then you need some loop and decision logic.

So what is your programming/scripting skill in Python?
Why did you talk about Java? any knowledge?

Revision history for this message
Kathyayani (kathyayani) said :
#5

Exactly, you understood correct.. i used "if else if" statement and Screen class while writing logic then Java Robo for controlling the operations,

am Using Selenium IDE and Java language. Here am surfing for the information to write a logic..

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

the principal approach in pseudo code:

while true {

  if (exists(popup1, 0)) {
    // do what has to be done
  } else if (exists(popup2, 0)) {
    // do what has to be done
  } else if (exists(popup3, 0)) {
    // do what has to be done
  } else if(exists(popup4, 0)) {
    // do what has to be done
  } else if {
    // may be wait some time before next loop turn
    // or decide to terminate the loop
  }

}

exists() is a SikuliX feature, that returns null if not found and the match otherwise.
the second parameter 0 tells exists to not wait for the image, but only look for it one time (so rather fast).

Revision history for this message
Kathyayani (kathyayani) said :
#7

Super.. let me try this.. Thank you RaiMan!

Can you help with this problem?

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

To post a message you must log in.