How to create a banner for the test run?

Asked by SD

Is there a way to create a banner on the screen that would notify observers that a test is running?

Would it be possible to have that banner pop up in different areas on the screen?

Thank you

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
RaiMan (raimund-hocke) said :
#2

Currently there is no such feature available (Is on the list for 2.0.6).

You can do the following workaround:

where = Region(300, 300, 1, 1)

def blocker(loc):
    Do.popError("Do not touch anything\nJust watch", loc)

import thread

# create a popup at the specified location (popup center)
thread.start_new_thread(blocker, (where,))

wait(3) # here comes your payload

# this will close the popup
click(where)
type(Key.ENTER)

wait(3) # more payload

This solution currently has a caveat: each popup creates an undecorated frame (size 2x2, tiny window), that will not be disposed when the popup closes. the tiny windows vanish, when the IDE shuts down.

If this tiny problem is a problem: from SikuliX scripts the complete Java world is useable: create your own JFrame with a text label, make it visible, move it around and close it as needed.

Can you help with this problem?

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

To post a message you must log in.