Script di aiuto Sikulix

Questa guida utente descrive le funzioni aggiuntive di SikuliX utilizzate per l'integrazione con SKOOR. La documentazione completa di SikuliX è disponibile nella pagina dedicata al progetto http://sikulix.com/.

SkoorUtils

Import

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

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

Import

from skoor import SkoorTimer

Funzioni

Timer(name)

Crea una nuova istanza timer denominata.

start()

stop()

pause()

resume()

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

Esegue un'waitStable e arresta il timer 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)

SkorScreenshot

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

Import

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 fileName, il valore 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 fileName, il valore predefinito è <testName>.screenshot.png.