waitVanish

Asked by Marc Summers

    dbuttons = list(findAll("downloadcharts.png"))
    print "I Found ", len(dbuttons), " matches"
    dbuttsorted = sorted(dbuttons, key=lambda m: m.y)

    hover(dbuttsorted[0]) <<< if this works, and it does then

    waitVanish(dbuttsorted[0], 700) Why would this NOT work ?

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
masuo
Solved:
Last query:
Last reply:
Revision history for this message
masuo (masuo-ohara) said :
#1

findAll() returns one or more Match objects.
hover() accepts Match objects as an argument.
But waitVanish() does not accept Match objects as an argument.

PSMRL – a pattern, a string, a match, a region or a location that evaluates

https://sikulix-2014.readthedocs.io/en/latest/region.html#Region.hover
hover(PSMRL)

https://sikulix-2014.readthedocs.io/en/latest/region.html#Region.findAll
findAll(PS)

https://sikulix-2014.readthedocs.io/en/latest/region.html#Region.waitVanish
waitVanish(PS[, seconds])

Revision history for this message
Marc Summers (2aircraft) said :
#2

One of the issues I have to deal with are that
there are multiple "exactly the same" images on screen.

I need a sorted listing of all of the images so that I can properly
pick the correct one that I need to click on.

So how do I make a listing of like images, put them in order
and then still be able to call something like this:

waitVanish("my list sorted image", 700)

when waitVanish() does not accept Match objects as an argument.

Revision history for this message
masuo (masuo-ohara) said :
#3

Define Region r from Match objects .
Specify Region r and use waitVanish.

r.waitVanish()

Revision history for this message
Marc Summers (2aircraft) said :
#4

Hello Masuo:

Sorry, but I need more of a complete example
as to how this would be implemented.

Thanks.

Revision history for this message
Best masuo (masuo-ohara) said :
#5

This is a simplified example.
m=find(image)
r=Region(m.getX(), m.getY(), m.getW(), m.getH())
r.waitVanish(image, seconds)

Revision history for this message
Marc Summers (2aircraft) said :
#6

Yes, Excellent answer !
This works perfectly!

Thanks for your help,
it is much appreciated.