[2.0.5] click text in region does not work --- workaround

Asked by TestMechanic on 2021-03-16

confirmed bug -------------------------------------- workaround


seems to work.

---------------------------------------------- will be fixed in 2.0.6


reg = <some_region>
reg.click('text_in_region') # does not click on text

see video https://www.screencast.com/t/yIdZvomTCvpz

Seems like click is executed on relative coordinates against Screen not against region
This seems like a bug
Note that "reg.click(image_in_region.png) works s expected

Question information

English Edit question
SikuliX Edit question
No assignee Edit question
Last query:
Last reply:
Chetan (cshamdas) said : #1

can you try below
control=findText("txt to search")

TestMechanic (ndinev) said : #2

Your solution does not include use of region

I found this workaround


Chetan (cshamdas) said : #3

for region we can create a regsion and then you
region= new region()...# define it
then control = region.findText()

RaiMan (raimund-hocke) said : #4

Both are functional equivalent:
- have some region
- wait for some text to appear or find it in that region
- click the match

yours is the one-liner shortcut

Yours has the advantage, that you can use the match later via control, instead of the need to write later
control = reg.getLastmatch()

RaiMan (raimund-hocke) said : #5

so happy to be solved

TestMechanic (ndinev) said : #6

@RaiMan just wondering for the original question - why reg.click does not work - is this a bug?

RaiMan (raimund-hocke) said : #7

Sorry, missed that. Seems you are using 2.0.4
this is indeed a bug, fixed in 2.0.5: https://github.com/RaiMan/SikuliX1/issues/338

TestMechanic (ndinev) said : #8

I am using 2.0.5
See the link in the original message. You can see the title of the IDE

RaiMan (raimund-hocke) said : #9

Thanks for feedback.

checked, confirmed --- is now a bug.