Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Sikuli for Android testing?

I am testing an Android application with Sikuli, but each time the test runs the behaviour is different:

  • the test stops at the first command, not finding the first image
  • finds only some images and the test stops at a particular image which isn't found
  • finds all images and the test runs successfully

Here is the example test and one of its behaviour when running it.

Sikuli is runned on Windows 7. Does anyone know if it's a problem of focus or something else and how to solve it?

Thanks

like image 1000
blavi Avatar asked Feb 03 '26 01:02

blavi


2 Answers

Maybe you can fix your recognition issue by changing the matching level. From Sikuli Gui :

  • Click on the image
  • In Pattern Settings > Matching Preview, drag the Similarity bar to a value below 1.0 (try different values)
like image 83
Orabîg Avatar answered Feb 04 '26 14:02

Orabîg


You may also need to add a delay for the browse button to appear on the screen. You could try something like this

wait("Browse.png", 10 )  # Wait for up to 10s for the app to load

You might also try increasing the size of the picture that you are matching to. Try including nearby artifacts. Remember that you can change the location on the picture that is the mouse click point if your Browse button is not dead centre.

like image 35
spearson Avatar answered Feb 04 '26 15:02

spearson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!