Wait function in sikulix IDE

Asked by harvi

is there any change in the code do it need to make

waitvanish(img."forever")

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
masuo (masuo-ohara) said :
#1

Do you want to know usage of "waitVanish" ?
http://sikulix-2014.readthedocs.io/en/latest/region.html?highlight=waitVanish#Region.waitVanish

waitVanish("img.png", FOREVER)

waitvanish -->waitVanish
img. --> "img.png,"
"forever" -->FOREVER

Revision history for this message
harvi (subbnison) said :
#2

I dont think wait vanishes works properly, logically none should run until the existing command is complete, But in my case it just moves on to next line

Revision history for this message
harvi (subbnison) said :
#3

When i use Forever even after the existing has vanished , it doesnot move to next command

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

waitVanish() needs that the target image is there and then vanishes.
If it is not there from beginning, this is also success.

Revision history for this message
harvi (subbnison) said :
#5

In my case target image is the trobber, when the throbber vanishes the click () is invoked but what really happens is before trobber vanishes , click() is initiated and am unable to move further

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

... then this means, that "throbber" is not yet visible, when waitVanish() starts its observation.

try this
wait("img.png") # this ensures, that img.png is visible, before waitVanish starts.
waitVanish("img.png", FOREVER)

Revision history for this message
harvi (subbnison) said :
#7

 I have progressed my testing of an specific web page with the help of click(), but there is one specific web page in my application, where click() does not execute, even after using waitVanish("img.png", FOREVER), none happens, where am sure that i have given coorect function to click

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

what about comment #6?

Revision history for this message
harvi (subbnison) said :
#9

no bro!!! this was the one i mentioned about, upon giving waitVanish("img.png", FOREVER). nothing happens further ,the cursor just stays where it is

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

ok, the usual way to test such situations is as follows:

... supposing img.png is the image that gets visible and then we wait for it to vanish:

if exists("img.png"):
    highlight()
    waitVanish("img.png", 60)
else:
    print "img.png did not appear within 3 seconds"
    exit()

Revision history for this message
harvi (subbnison) said :
#11

Thanks a lot mate!!! i think its time to switch off my noobie mood and start working more harder

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

Yep ;-)
If you want more, you have to invest more. all the best.

Can you help with this problem?

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

To post a message you must log in.