J'ai joué un peu avec Sikuli ...

Par j0k le mardi 16 février 2010, 08:22 dans développement - 25398 vues

Comme toute geek développeur 2.0 qui se respecte, je fais de la veille. Le problème de cette veille c'est qu'on voit passer plein de nouveau script, nouvelle technique, nouveau langage, etc ... On regarde un peu en diagonale et on se dit que ça semble hyper intéressant, on bookmark, on twitte, on share en se disant qu'on regardera au moment venu. Ce moment arrive très très rarement.

Il y a quelques temps j'ai vu passé le projet Sikuli. Sikuli permet de contrôler une interface graphique en se basant sur des images. Les exemples données sur le site officiel montrent comment contrôler le changement de statut sur Skype, changer une adresse IP, etc .. Pour des raisons personnelles, j'ai dû me pencher sur Sikuli pour mettre en place quelques automatisations. Voilà un peu ce que je retiens (pour le moment) de mon utilisation de Sikuli.

Prise en main

L'installation est très rapide (sous réserve que vous ayez déjà java d'installer). L'IDE fournit avec Sikuli est très basique (trop même des fois).L'affichage est divisé en 3 parties:

  • L'éditeur à proprement parler (continuellement en mode pseudo wysiwyg)
  • Le trace du traitement
  • Un encart pour les tests unitaires

Utilisation

L'autocompletion n'est pas toujours active, mais les fonctions utilisées sont très basiques: find(), click(), etc ... chaque fonction de ce genre prend en paramètre un screenshot. Il suffit de cliquer sur le bouton pour prendre un screenshot: l'IDE se ferme, un voile gris se mets sur votre écran et vous pouvez sélectionner une zone pour le screenshot. L'image est ensuite enregistrée dans le dossier de votre projet et apparait en paramètre de votre fonction. Une fois le screenshot pris, en cliquant dessus on peut émuler la recherche de ce screenshot sur l'écran et ainsi ajuster la similitude. Ainsi, on peut reconnaitre une forme même si par exemple, elle se retrouve avec une autre forme par dessus (dans l'absolu).

Pour tester notre bout de code, on peut lancer un mode "pas à pas", qui va vous montrer ce que trouve le script avant de faire les actions. Pratique pour voir comment se déroule la recherche.

Côté code, c'est du Jython. Un interpréteur Python écrit en Java. Chaque projet est constitué de deux fichiers sources:

  • un .py qui correspond au code brut
  • un .html qui est la représentation avec les images dans l'IDE

En regardant le code du .py, on voit très bien que c'est du Python (non sans dec' ?) et que toutes les références faites aux images, sont les noms de fichier présent dans le même dossier:

c2 = find(Pattern("1265534956718.png").similar(0.65))

C'est pratique des fois pour affiner quelques éléments dans le code. Un peu comme quand on développait sous Dreamweaver en mode Wysiwyg complet et que de temps en temps il fallait corriger à la main les lignes de codes dégueulasse qu'il générait ! ..

A la longue

Le p'tit script que j'ai développé tourne toutes les nuits pour faire, à ma place, ce que je fais dans la journée. J'ai souvent été emmené à avoir des problèmes de mémoires, le script faisant souvent des reloads dans Chrome, je devais rapidement atteindre le maximum de mémoire vive et le matin, je me rendais compte que mon onglet utilisé quelques choses comme 600Mo ...

Un autre problème concerne le stockage des screenshots qu'il fait pour faire ses recherches. A chaque fois que vous utilisez find(), click() et ces copains, Sikuli prends un screenshot de votre écran, le stocke dans le dossier temporaire de la machine, fait la recherche dans cette image à partir de votre screenshot et une fois fini, il ne supprime pas le fichier ! Je vous laisse imaginer un tel script tourner pendant plusieurs nuits d'affiler .. J'ai eu droit à "espace disque insuffisant sur C:". Les screenshots prenaient ... 25Go .. C'est un bug connu. Pour pallier au bug, j'ai fait un méthode qui ouvre un terminal, écrit une ligne de commande qui supprime tous les fichiers temporaires, mais bon ...

L'IDE présente des p'tits soucis de copier/coller mal géré. Le Ctrl+Z ne fonctionne pas non plus ... et ça, c'est sacrément handicapant.

Quand on lance un script, l'IDE de Sikuli se ferme pour tourner en tache de fond. Il existe normalement un raccourci clavier (Alt+ Maj + C) qui permet de forcer l'arrêt. Mais il n'a jamais fonctionné chez moi ... obligé de killer à la main javaw.exe. Le problème dans ce cas, c'est qu'on perds les modifications faites et non enregistrées de notre script. Ahem

Mais ça sert à quoi en fait ?

Le site officiel grouille d'utilisation plus ou moins intéressantes: tweeter, faire le ménage sur son pc, changer son statut facebook, etc ... On pourrait éventuellement s'en servir pour faire des tests fonctionnels d'application. Un peu comme si on utilisait sfWebBrowserPlugin quoi :-)

L'idée qui me vient en tête c'est la création de bots par exemple, pour automatiser l'inscription, la pollution, etc .. Il est assez simple de casser un captcha avec Sikuli, il faut simplement constituer la base de données des images potentielles pour le faire (je l'ai fait donc ..).

5 commentaires en tout !

1. marie le dimanche 08 mai 2011, 00:27 #permalien
marie

hello
Merci de m'avoir fait découvrir sikuli !! super logiciel.
J'ai une tite faveur à te demander :)
Peux tu m'en dire + sur le cassage de captcha please? Ce serait très sympa. J'ai un compte décaptcher mais je vois pas trop comment l'intégrer à sikuli...
Longue vie à ton blog !
Marie
PS mon mail est renseigné si tu veux me recontacter merki :)

2. JerrySlucT le mardi 29 janvier 2019, 15:08 #permalien
JerrySlucT

hOur company provides a wide variety of pharmacy. Visit our health contributing website in case you want to strengthen your health. [url=http://p6e.thebestrealrx.com/es/prednisolone-2/prednisolone-36-horas-precio-17807.html]http://p6e.thebestrealrx.com/es/prednisolone-2/prednisolone-36-horas-precio-17807.html[/url] Our company offers a wide variety of non prescription products. Look at our health portal in case you want to look healthier with a help generic supplements. [url=http://ti0.thebestrealrx.com/fr/viagra-4/viagra-en-ligne-rkw-46527.html]http://ti0.thebestrealrx.com/fr/viagra-4/viagra-en-ligne-rkw-46527.html[/url] Our company offers a wide variety of supplements. Take a look at our health contributing portal in case you want to feel healthier. [url=http://5h.thebestrealrx.com/fi/baclofen-4/jotta-baclofen-europa-67351.html]http://5h.thebestrealrx.com/fi/baclofen-4/jotta-baclofen-europa-67351.html[/url] Our company offers a wide variety of non prescription products. Visit our health site in case you want to feel better with a help generic supplements. [url=http://bz3.thebestrealrx.com/it/tadapox-6/tadapox-5-mg-vendita-81753.html]http://bz3.thebestrealrx.com/it/tadapox-6/tadapox-5-mg-vendita-81753.html[/url] Our company offers herb-based supplements. Take a look at our health contributing portal in case you want to look better. http://bz3.thebestrealrx.com/de/tadapox-6/preis-fuer-tadapox-5mg-34464.html Our company offers generic supplements. Look at our health contributing website in case you want to look healthier. [url=http://ti0.thebestrealrx.com/nl/viagra-5/viagra-niet-receptplichtige-iu-health-78125.html]http://ti0.thebestrealrx.com/nl/viagra-5/viagra-niet-receptplichtige-iu-health-78125.html[/url]

Our company offers a wide variety of non prescription products. Visit our health portal in case you want to look healthier with a help generic supplements. [url=http://5a5z.thebestrealrx.com/sv/ampicillin-5/bestaella-ampicillin-p-naetet-47099.html]http://5a5z.thebestrealrx.com/sv/ampicillin-5/bestaella-ampicillin-p-naetet-47099.html[/url] Our company provides supreme quality pills. Visit our health contributing portal in case you want to feel better. [url=http://u8.thebestrealrx.com/fr/zofran-8/vente-zofran-nbrik-70589.html]http://u8.thebestrealrx.com/fr/zofran-8/vente-zofran-nbrik-70589.html[/url] Our company offers a wide variety of non prescription products. Visit our health site in case you want to look better with a help of health products. [url=http://ro4.thebestrealrx.com/sv/sildalis-2/sildalis-inget-recept-orehnjaca-90859.html]http://ro4.thebestrealrx.com/sv/sildalis-2/sildalis-inget-recept-orehnjaca-90859.html[/url] Our company offers a wide variety of non prescription products. Visit our health site in case you want to strengthen your health with a help of general health products. http://rn0.thebestrealrx.com/en/silagra-3/silagra-non-prescription-mh370-55125.html Our company offers a wide variety of non prescription drugs. Look at our health site in case you want to feel better with a help of health products.

3. AilaCeash le dimanche 17 février 2019, 20:35 #permalien
AilaCeash

Correspond to power bases are occupied in somehas to be done supervised direct supervision of an grown-up with a view safety reasons. There is yon a % chance of recurrence in years, so rudimentary prosta-tectomy is of no aid C. Cue yourself to intimation profoundly every so ofttimes [url=http://motoringdeals.com/study/relevant-experience7/opinion5/]generic diclofenac 100mg amex[/url].

Finally, the competitive athlete understands the value of the rehabilita- tion program and disposition not wait to spend three hours a broad daylight in the gym. Recompense increased impact, the cleverness illustrated the action with a third year undergraduate medical students. Hunky yob men bed [url=http://motoringdeals.com/study/relevant-experience7/opinion10/]generic paroxetine 40mg with visa[/url]. Preganglionic efferent nerves start up from neurons in the brainstem or sacral spinal twine, submit the postganglionic neurons in PaSNS ganglia and issue ACh (orange trapezoid) at synapses with postganglionic neurons (environmentalist). The antigen-presenting cells of the CNS, microglia, proximate antigen via the pre-eminent histocompatibility complex (MHC) excellence II. What is round pressure [url=http://motoringdeals.com/study/relevant-experience7/opinion8/]generic medrol 16 mg mastercard[/url]. When you resume medicines away mouth, they stir up at the end of one's tether with the digestive patch and are taken up nearby internal organs like the taste and small intestine. Looking for those looking to farm out a wheelchair or lift bench, attack our medical accoutrements rentals folio conducive to additional information. We gormandise [url=http://motoringdeals.com/study/relevant-experience7/opinion7/]order shallaki 60caps without a prescription[/url]. At unusually enormous levels they manifest there is what amounts to a fortune of compost in the facetious adam's ale, which could easily involve pathogens (Ten thousand comprehensive coliform bacteria ordain depart you a strand closure, compared to two or four hundred fecal coliforms, or fifty enterococcus). Gastroduodenal ailment, and preoperative nutritional status well correlated with the operative outcome, and then the most fitting and momentous nutritional parameters had punctilious predicted mother wit looking for the chance of postoperative complications. Schiffl H, Lang SM, Konig A, et al [url=http://motoringdeals.com/study/relevant-experience7/opinion6/]rabeprazole 20 mg low cost[/url]. Even after the struggling, Set experienced firsthand the results of this dilemma. Diagnosis Formal diagnostic criteria include: (a) sally of symptoms in the past age 21; (b) the pre- sence of multiple motor and at least sole vocal tic (not necessarily concurrently); (c) a waxing and waning practice, with tics evolving in a continuing attitude; (d) the mien of tic symptoms for at least 1 year; (e) the lack of a precipitating illnesses (e. You won't rue it [url=http://motoringdeals.com/study/relevant-experience7/opinion4/]80mg super levitra with amex[/url].

Bush bushes are visually beseeching with flannel blossoms in ripe leaping. Drug-therapy hawthorn be needful for your unhealthy procedure. The aim of oxidization tardily deteriorates [url=http://motoringdeals.com/study/relevant-experience7/opinion3/]cheap promethazine 25 mg without prescription[/url]. The sack profundity on english of projection is metrical with a dentistry putz. This implementation that you are victimization multi shared movements that train a all-embracing limit of heftiness groups for utmost tough maturation. George mythologist testified on his studies of diabetes in Zulus and dominion Indians in region continent [url=http://motoringdeals.com/study/relevant-experience7/opinion9/]order lopressor 50 mg amex[/url]. Trabeculae last from the capsule to sunder the lymph node into lobules. Positively, Miller and colleagues (Miller and Chen 2010) include shown that once again a space of 1. It too helps in harmonizing imbalances in the skittish organization [url=http://motoringdeals.com/study/relevant-experience7/opinion2/]0.4mg flomax visa[/url]. Il n'y a que des traces dans le oolorant mais ce n'est pas la meilleure idee et j'ai demande au labo de changer. Cushions • Incontinence Supplies • Puncture Guardianship & Dressings • Nebulizers • Orthotics • Mobility Equipment • Arthritis Supplies • Blood Coercion Cuffs • Drumming Oximeters • Ostomy Products • Bath Safety & Commodes • CPR Refuge • Braces & Supports • Heart Prosthesis, Bras & Swimsuits and much more! They are meat of ablutionary and murder i [url=http://motoringdeals.com/study/relevant-experience7/opinion1/]buy topamax 200 mg overnight delivery[/url].

4. Dawsonmaync le dimanche 17 février 2019, 20:47 #permalien
Dawsonmaync

Hidrosis tests are likewise authorised for investigating for marihuana have. Propulsion from a sort of specialistic therapy techniques, unambiguously catered counselling programs straightaway direction apiece person's particularised status. It was an unpaired pick for deuce reasons [url=http://privatetoursedinburgh.com/wp-content/professional-experience/terminology-55/lasix-generic/]generic 40mg lasix amex[/url].

The patchwork of mammography with ultrasound and the microscopic writing-room of cells extracted from a question excrescence through ?first-class needle dream of? has greatly improved the diagnostic consciousness of this process in the 1990s. The clinical neuroscience community was smart to pick up on the power of this recognition and Barkes Transcranial Alluring Stimulation (TMS) was a moment widely hand-me-down to measure bravery conduction velocities in clinical and surgical settings. Thus, should they be thin, or leastwise not gormandise [url=http://privatetoursedinburgh.com/wp-content/professional-experience/terminology-55/acticin-generic/]buy 30gm acticin overnight delivery[/url]. A mul- ticenter point of view II randomized controlled fling of marred curet- tage in patients with persistent, low-risk nonmetastatic GTN (GOG-0242, NTC00521118) is currently underway. And so a stimulus exposed to a point notwithstanding solitary a not many milliseconds, with no awareness of what was presented to the humble, may restful bring to priming effects which can predilection later processing (Streak and Biederman 1998). The animals that ate it began losing burthen [url=http://privatetoursedinburgh.com/wp-content/professional-experience/terminology-55/pyridostigmine-generic/]generic 60mg pyridostigmine otc[/url]. But nigh importantly, it strengthens the doctor-patient relation. 10. Andrew general T Criminal Law SolicitorsDr [url=http://privatetoursedinburgh.com/wp-content/professional-experience/terminology-55/acivir-pills-generic/]order acivir pills 200 mg fast delivery[/url].

Allina Haleness Home Oxygen & Medical Trappings is licensed to bring into the world medication medical devices in Minnesota, Wisconsin and states that do not require out-of-state licensure. At your service, our sagacious team on rig out you with the supplies and knowledge you make to remain comfortable at home. We postulate these questions every daylight [url=http://privatetoursedinburgh.com/wp-content/professional-experience/terminology-55/periactin-generic/]buy periactin 4 mg visa[/url]. Traditionally, imperfect spinal rope lesions secure been defined as those in which some sensory or motor gathering is preserved less the unalterable of neurological impairment. In review, I can clear the young physician staffing the silent clinic that sultry Saturday afternoon on his weary look of in- credulity. Possibly you were dead diagnosed with a addicted unhealthiness [url=http://privatetoursedinburgh.com/wp-content/professional-experience/terminology-55/dostinex-generic/]0.25 mg dostinex for sale[/url]. Although vulvar cancer is rare, with an annual extent of 2В­3 per 100,000 women, it is estimated that T3/T4 infirmity occurs in approaching 20 % of patients at clinical presenta- tion, and approximately 30 % will have identified inguino- femoral lymph node involvement [2, 3]. In this figure, sequences of the dihydrofolate reductase-thymidilate synthase (DHFR-TS), a conserved housekeeping gene that is functionally tantamount total all Leishmania species, were aligned and used to record Leishmania phylogeny. The standing of eudaemonia viewing continues finished immaturity [url=http://privatetoursedinburgh.com/wp-content/professional-experience/terminology-55/yasmin-generic/]purchase 3.03mg yasmin with visa[/url].

They allow for scrupulous assessment of the adequacy of oxygenation, along with tenacity of acid/base status and of the adequacy of ventilation. The causes of downfall among 25 deaths showed that some be that as it may dying is not directly attributable to amoebiasis although it acts as a contributing factor. - So what nearly the episodic hamburger [url=http://privatetoursedinburgh.com/wp-content/professional-experience/terminology-55/clozaril-generic/]purchase 100mg clozaril amex[/url]. There is an initial hipadduction proposition in incline acceptance followed in midstance and terminalstance with easy abduction. Latent infection is characterized nearby intermittent episodes ofacute or subclinical infection with no virus detected between episodes. Much substance for little money [url=http://privatetoursedinburgh.com/wp-content/professional-experience/terminology-55/amaryl-generic/]cheap amaryl 1 mg on-line[/url]. The buttocks aspect of the vastus lateralis is stripped offthe proximal femur as glowingly, making sure that secondary to the posteriorproximal expiration of the femur can be palpated. 17 This wrong is not likely tooccur in children with CP because the direct of pain it would agent wouldmake it clarify b tidy up to all caretakers that the children are not skilled to weather theorthotic. We are biologic ingestion machines' [url=http://privatetoursedinburgh.com/wp-content/professional-experience/terminology-55/tricor-generic/]order 160mg tricor mastercard[/url].

5. Quincygup le dimanche 03 mars 2019, 15:11 #permalien
Quincygup

hOur site offers a wide variety of non prescription products. Look at our health website in case you want to strengthen your health with a help of health products. [url=http://8a9h.buyprednisolonenow.com/no/prednisolone-pris-xs-las-vegas-91780.html]http://8a9h.buyprednisolonenow.com/no/prednisolone-pris-xs-las-vegas-91780.html[/url] Our company offers herb-based general health products. Visit our health contributing portal in case you want to strengthen your health. [url=http://o90z.buyprednisolonenow.com/de/preis-fuer-prednisolone-in-apotheke-91446.html]http://o90z.buyprednisolonenow.com/de/preis-fuer-prednisolone-in-apotheke-91446.html[/url] Our company provides supreme quality pills. Look at our health contributing website in case you want to feel healthier. [url=http://ph6.buyprednisolonenow.com/fr/prednisolone-en-ligne-oyonnax-65433.html]http://ph6.buyprednisolonenow.com/fr/prednisolone-en-ligne-oyonnax-65433.html[/url] Our company offers safe supplements. Visit our health contributing website in case you want to strengthen your health. [url=http://2n.buyprednisolonenow.com/fi/halpoja-prednisolone-shot-46614.html]http://2n.buyprednisolonenow.com/fi/halpoja-prednisolone-shot-46614.html[/url] Our company offers a wide variety of healthcare products. Take a look at our health contributing site in case you want to feel healthier. http://82qk.buyprednisolonenow.com/nl/can-you-buy-prednisolone-online-forums-45945.html Our company provides a wide variety of non prescription products. Look at our health website in case you want to feel better with a help health products. [url=http://8vl.buyprednisolonenow.com/es/prednisolone-similar-precio-33865.html]http://8vl.buyprednisolonenow.com/es/prednisolone-similar-precio-33865.html[/url]

Our company provides a wide variety of non prescription drugs. Take a look at our health site in case you want to to improve your health with a help generic supplements. [url=http://j3o.buyprednisolonenow.com/da/kobe-prednisolone-zqk-32193.html]http://j3o.buyprednisolonenow.com/da/kobe-prednisolone-zqk-32193.html[/url] Our company offers health and related products. Look at our health contributing portal in case you want to strengthen your health. [url=http://g5h.buyprednisolonenow.com/sv/rea-prednisolone-hk-express-83330.html]http://g5h.buyprednisolonenow.com/sv/rea-prednisolone-hk-express-83330.html[/url] Our company offers a wide variety of non prescription drugs. Take a look at our health site in case you want to look healthier with a help of general health products. [url=http://m15e.buyprednisolonenow.com/fi/prednisolone-ilman-reseptiae-fox-24740.html]http://m15e.buyprednisolonenow.com/fi/prednisolone-ilman-reseptiae-fox-24740.html[/url] Our company provides a wide variety of health and related products. Look at our health contributing portal in case you want to feel better. http://60ki.buyprednisolonenow.com/it/prednisolone-confezioni-costo-82634.html Our company provides supreme quality healthcare products. Look at our health contributing site in case you want to look better.

Pensez à vous inscrire !

  • C'est rapide
  • Utiliser votre compte Facebook
  • Ou votre Open ID
Laisser un commentaire





Catégories


Tags


Liens