how can to control FindFailed

Asked by thuan on 2018-01-20

Can you help me control using throws FinFailed when action screen.click (sikuliapi 1.1.1 sikuli core 1.2.0)
because i see if case failed this case always passed.
so I don't want using throw FindFailed in function, how can please help me. :(

----
try {
            waitU.sleep(2500);
            String english = path_image_os + "/selectlanguage/english.png"; // Wrong path image
            sikulix.click(english);
        } catch (FindFailed failed) {
            failed.printStackTrace();
        }

-----

Assert.assertTrue(verifyThePopup.verifyImageExists(selectLanguagePage.getImageEnglish()));
selectLanguagePage.selectEnglish();

thanks

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2018-01-20
Last reply:
2018-01-23
RaiMan (raimund-hocke) said : #1

on GitHub I understood, that you solved your issue????

So it is not clear, what you want with this question.

thuan (nguyen99) said : #2

Hi RaiMan

I want if using try catch(Findfailed) on the case failed displayed exception failed for case

RaiMan (raimund-hocke) said : #3

... then you should not catch the FindFailed exception.

thuan (nguyen99) said : #4

Hi RaiMan
if i don't use findFailed the Scree.click(); show required Findfailed.
I do not know why

RaiMan (raimund-hocke) said : #5

This all has nothing to do with SikuliX.

It is all about basic Java and JUnit knowledge.
So please do your homework.

thuan (nguyen99) said : #6

Hi Raiman
this is testNG FW not Junit,
I using selenium + testNG+ sikuli. language java

thuan (nguyen99) said : #7

Hi Raiman
this is testNG FW not Junit,
I using selenium + testNG+ sikuli. language java

RaiMan (raimund-hocke) said : #8

ok, so:

This all has nothing to do with SikuliX.

It is all about basic Java and TestNG FW knowledge.
So please do your homework.

thuan (nguyen99) said : #9

thanks Raimain again
 i have a question.
currently i using MAC OS Sierra 10.12.6
So, what is version sikuli ediror on Mac

Thanks

RaiMan (raimund-hocke) said : #10

version 1.1.1 or even 1.1.2 nightly.

thuan (nguyen99) said : #11

Hi raiman
I using sikuli api 1.1.1 or 1.2.0
error message:
FindFailed: can not find P(/Users/bacoor/Documents/Projects/Sikuli/desktopwallet/images/macPro15.4/selectlanguage/english.png) S: 0.7 T: 0,200 in S(0)[0,0 1440x900]

  Line 2189, in file Region.java

i think do not error path image
what is error?

thuan (nguyen99) said : #12

Screen screen = new Screen();
            Pattern pattern=new Pattern("/Users/bacoor/Documents/Projects/Sikuli/desktopwallet/images/macPro15.4/selectlanguage/english.png");
            pattern.similar(0.70f).targetOffset(0,200);

screen.click(pattern);

thuan (nguyen99) said : #13

Hi Raiman

Supported systems
SikuliX can be used on systems with Windows XP and later including Windows 8 and 10 (32-Bit or 64-Bit) Mac OSX 10.6 and later including 10.10 and 10.11 (64-Bit only) Linux/Unix systems depending on the availability of the prerequisites (32-Bit or 64-Bit)

so currently i using MAC 10.12.6 , so i do not using sikuli?

RaiMan (raimund-hocke) said : #14

-- 1. SikuliX surely works on all macOS, since I am developing on macOS (currently 10.13.2)

-- 2. FindFailed means, that the image (if the file exists) cannot be found on the screen in that moment.
So again: understand how SikuliX works and read about the options around FindFailed.
http://sikulix-2014.readthedocs.io/en/latest/basicinfo.html#sikulix-how-does-it-find-images-on-the-screen
http://sikulix-2014.readthedocs.io/en/latest/region.html#exception-findfailed

If you want to get rid of FindFailed handling, you should think about using exists() and if/else.

Can you help with this problem?

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

To post a message you must log in.