how to copy Message tab data into file

Asked by zeeshan

I am new to this software and trying to find out the best way of confirming test results in a separate file i.e. actions I execute via automated scripts, I currently print the text and see it show up in the messages but now sure how this can be copied to a separate file or email.

2) I have default setting of Sikuli not sure how I can improve its response when it does not find its itended dialog. for e.g. If I try to type("t" KEY_ALT) to show tools menu of our app but if for some reason this doesnt happen Sikuli never respond the failure and I have to terminate execution to stop. I have simple script with click and wait commands including some short cuts as above.

Thank you in advance for helping me in above...

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

--1. messages to a file
run script from command line and pipe output to a file with >log.txt

--2. Sikuli's awareness of failures
Based on your question, one has to say, that Sikuli is dumb: It simply does what you script, but cannot tell you, wether the action did with the app, what you expected.
Sikuli can only tell you, what is visible on the screen or not. And it only looks for the images you have scripted.

In the case of type() you either have to go the risk, that it does not work with your app (which means you have to kill the script in case it does not work as expected), or you make sure in your script after the type(), that the script can continue, by checking the visual content of the screen.

e.g.
type("t", KEY_ALT)
if not exists("some-image-that-tells-ok.png"):
    print "did not work"; exit(1)

Sikuli checks for existence "some-image-that-tells-ok.png" and if it does not show up within 3 seconds, the script ends here with your error message.

Another option instead of stopping might be to script corrective actions if possible at this point.

Revision history for this message
zeeshan (zeeshan-nawaz) said :
#2

Thanks RaiMan, that solved my question.