Unit testing - Assert Popup Message Box

Asked by Q17

Hi,

I have used the code below to verify if the image of a popup exists or not but it failed and it does not say why:

def testA(self):
        click(image1)
        wait(1)
        assert exists(PopUpImage)

Result -
File "C:\Installs\SikuliX\Validation.sikuli\Validation.py", line 10, in testA
assert exists(PopUpImage)

Can someone please tell me why does not recognize the popup?

Question information

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

this line
File "C:\Installs\SikuliX\Validation.sikuli\Validation.py", line 10, in testA
assert exists(images2)

is not from your posted def testA

Revision history for this message
Q17 (squery) said :
#2

Sorry it should be:

File "C:\Installs\SikuliX\Validation.sikuli\Validation.py", line 10, in testA
assert exists(PopUpImage)

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

exists does not tell you anything but True or False.

If you want information, you have to use find/wait and catch the FindFailed exception.

... but this will not give you more information: if exists returns False, the image is not found within 3 seconds on the screen.

So you have to check your click... workflow.

Revision history for this message
Q17 (squery) said :
#5

Ok thanks I will try find method.

Revision history for this message
Q17 (squery) said :
#6

Thanks RaiMan, that solved my question.