Script di aiuto Sikulix

La presente guida utente descrive le funzioni aggiuntive di SikuliX utilizzate per l'integrazione con SKOOR. La documentazione completa di SikuliX è disponibile sulla pagina del progetto all'indirizzo http://sikulix.com/.

SkoorUtils

Importa

from skoor import SkoorUtils

Funzioni

SkoorUtils.waitStable(pattern, stableRegion, minStableSeconds=2, timeout=None)

Attende un "pattern" dopo che "stableRegion" è rimasto stabile per "minStableSeconds".

Restituisce l'match e l'timestamp quando stableRegion ha iniziato a essere stabile per minStableSeconds.

Esempio
match, t = waitStable("1550299116977.png", Region(7,0,237,1024), 2, 10)
print(t)
click(match)

SkoorTimer

Genera un file timer SKOOR SikuliX in logs/<testname>.timer.out.

Importazione

from skoor import SkoorTimer

Funzioni

Timer(name)

Crea una nuova istanza di timer con nome specificato.

start()

stop()

pause()

resume()

stopAfterWaitStable(pattern, stableRegion, minStableSeconds=2, timeout=None)

Esegue un'operazione "waitStable" e arresta il timer in base al timestamp restituito.

pauseAfterWaitStable(pattern, stableRegion, minStableSeconds=2, timeout=None)

Esegue un'operazione "waitStable" e mette in pausa il timer al timestamp restituito.

Esempi

Timer semplice
timer = SkoorTimer("main")
timer.start()
# do something
timer.stop()

Crea un timer avviato
timer = SkoorTimer("main").start()
# do something
timer.stop()

stopAfterWaitStable
SkoorTimer("main").start().stopAfterWaitStable("1550299116977.png", Region(7,0,237,1024), 2, 10)

SkoorScreenshot

Gli screenshot senza nome vengono sempre eliminati all'avvio dello script.

Importa

from skoor import SkoorScreenshot

Funzioni

SkoorScreenshot.capture(fileName=None)

Crea uno screenshot dell'intero schermo e lo salva in logs/<fileName>

Se non viene specificato alcun percorso (fileName), il percorso predefinito è <testName>.screenshot.png.

SkoorScreenshot.captureFocusedWindow(fileName=None)

Crea uno screenshot della finestra attualmente attiva e lo salva in logs/<fileName>.

Se non viene specificato alcun percorso fileName, il percorso predefinito è <testName>.screenshot.png.