How to select textbox next to fixed text using sikuli in Java?

Asked by Amol

In my case, I need to select and clear text box value from the application. Text box value is dynamic but one text before the text box is fixed.

How would I acheive this? Please suggest.

Thanks in advance,

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Amol
Solved:
Last query:
Last reply:
Revision history for this message
Eugene S (shragovich) said :
#1

The most straightforward way to do that will be locating that constant text label and storing. Then you can define the region you are interested in in relation to it.

For example:

relativeReg = find("iamge.png")
reg = Region(relativeReg )
reg = Region(relativeReg.x + X, relativeReg.y + Y, relativeReg.w + W, relativeReg.h + H)

where X,Y,W and H are the distance in pixels that you will have to set manually.

when you have your region, you can click (or double click it to select select the text) and do whatever you want to do with that field.

Revision history for this message
Amol (amolapple14) said :
#2

Its working... Thanks a lot.