Text comparison then if loop

Asked by Gaurish Kaushal

I have a screenshot which can explain my issue. I have added all information in the screenshot.
Where can i attach it?

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Roman Podolyan (podolyan-roman) said :
#1

Upload it to some open image sharing service (tinypic... whatever) and post link to image here.

Revision history for this message
Gaurish Kaushal (gaurish-kaushal) said :
#2
Revision history for this message
RaiMan (raimund-hocke) said :
#3

I tried to read the text of a job name using Region.text(), but it is not possible with this font.

To click the button until SUCCESS appears:
button = find(button_image)
regCell = Region(x,y,w,h) # a somehow calculated region of one cell in column Status
while not regCell.exists("image-of-SUCCESS.png", 0):
    click(button)
    wait(1)
# SUCCESS appeared

Revision history for this message
Gaurish Kaushal (gaurish-kaushal) said :
#4

Thanks for the reply.
I have already tried it.

With this approach, its looking only for "success". But this success could be of last job also.
So what i need to do is to compare the Job name then check the status correspondingly.

One way i see is:
1. I know the actual Job Name (as i give it on first hand)
2. Pick the Job name from first row(copied in system clipboard), switch the app to textedit and compare the text.

I don't know, how should i write this in Sikuli script.

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

Ok, then if your GUI supports selecting a cell content somehow using the mouse (e.g. double-clicking into a cell), this is rather easy to accomplish.

An example: http://sikuli.org/blog/2010/05/06/extract-text-with-clipboard/

e.g.
col1 = find("image of col header.png")
doubleClick(col1.getCenter().below(35)
type("c", KeyModifier.CTRL) # text to clipboard
currJob = Env.getClipboard()
print currJob

It might be necessary to "clean" the clipboard content to compare it with your given job name.

Can you help with this problem?

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

To post a message you must log in.