![Page 1: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/1.jpg)
1
Outils d’automatisation de tests
d’interfaces Web
David GERBAULTIngénieurs 2000
Xposé 2010-2011
![Page 2: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/2.jpg)
2
WEBOGRAPHIE
http://seleniumhq.org/
http://www.clever-age.com/
http://watir.com/
![Page 3: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/3.jpg)
3
Pourquoi ce sujet?
![Page 4: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/4.jpg)
4
1. Présentation
2. Selenium
3. Watir
4. Conclusion
PLAN
![Page 5: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/5.jpg)
5
Souvent : tests du Contrôleur (code)
Rarement : tests de la Vue (Interface Web)
CONSTAT !1. Présentation
![Page 6: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/6.jpg)
6
Simuler l’interaction de(s) l’utilisateur(s) au travers de tests fonctionnels
OBJECTIF1. Présentation
![Page 7: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/7.jpg)
7
Automatisation de testsSelenium / CubicTest / Watir / AutoIT / Canoo / WebTest
Gestion des testsSelenium / Outils borland / Salome / TestLink / Fitnesse / Outil HP / Twist
Tests de chargeGrinder / OpenSta / JMeter
Model CheckingNModel / Smart testing / MaTeLo Qu’est ce que c’est ? : Vérification algorithmique d’un modèle donné, du système lui-même ou d’une abstraction du système, pour savoir si il satisfait une spécification, souvent formulée en termes de logique temporelle. = = > Curieux? Google it !
LES TESTS...1. Présentation
![Page 8: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/8.jpg)
8
Analystes programmeurConformité des développements par rapport aux besoins exprimés
Développeurs et équipes d’assurance qualité Valider le bon fonctionnement de l’application et le passage en production.
QUI ?1. Présentation
![Page 9: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/9.jpg)
9
Le test doit être joué plus d’une fois.
&
Le test peut être automatisé de bout en bout.
QUAND ?1. Présentation
![Page 10: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/10.jpg)
10
1. Lecture des besoins & spécifications.
2. Définition du périmètre de test.
3. Rédaction des cas de tests.
4. Enregistrement des tests dans l’outil.
5. Exécution des tests.
COMMENT?1. Présentation
![Page 11: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/11.jpg)
11
• Tests de non régressions fréquents
• Retour rapide aux développeurs pendant la phase de développement
• Cas de tests « illimités »
• Rapports personnalisés
• Convient aux développements Agile et d’eXtreme Programming
• Documentation rigoureuse des cas de tests
• Suppression des erreurs des tests manuels
CONSÉQUENCES?1. Présentation
![Page 12: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/12.jpg)
12
INTÉGRATION CONTINUE
Ecrire des tests dans le format voulu et adapté à l’outil d’intégration continue.
Exemple Selenium – Java (Junit) – Eclipse – Hudson
Exemple avec ant + Selenium + Hudson http://www.clever-age.com/veille/blog/integration-pas-a-pas-de-tests-selenium-dans-hudson.html
1. Présentation
![Page 13: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/13.jpg)
13
PROBLÈMATIQUESCe qu'il faut tester
• Contenus • Liens • Fonctions• Eléments dynamiques• Ajax
Résultats • Assert vs Verify• AssertTextPresent vs AssertElementPresent vs AssertText
Localisation • ID, name attribute, Xpath statement, Document Object Model• Findbugs• Objets dynamiques• AJAX (attente d'éléments)
1. Présentation
![Page 14: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/14.jpg)
14
SELENIUM2. Selenium
![Page 15: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/15.jpg)
15
SELENIUM
Distribué par OpenQA
licence libre Apache 2.0
8 logiciels : http://seleniumhq.org/projects/
http://code.google.com/p/selenium/
2. Selenium
![Page 16: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/16.jpg)
16
SELENIUM IDE
16
2. Selenium
![Page 17: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/17.jpg)
17
SELENIUM IDE2. Selenium
![Page 18: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/18.jpg)
18
SELENIUM IDE2. Selenium
![Page 19: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/19.jpg)
19
SELENIUM IDE2. Selenium
![Page 20: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/20.jpg)
20
SELENIUM IDE
Sélection intelligente des champs
2. Selenium
![Page 21: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/21.jpg)
21
SELENIUM IDE
Démonstration
2. Selenium
![Page 22: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/22.jpg)
22
SELENIUM IDE
Bilan selenium IDE
Enregistrement / Lecture des tests
3 Méthodes de constructions de tests• Enregistrement• Ajout de vérifications (assert)• Edition
2. Selenium
![Page 23: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/23.jpg)
23
SELENIUM IDE
Debug / Point d’arrêt
Sauvegarder/ExporterHTML, Java, Php, Perl, Python, C#...
Plugins
2. Selenium
![Page 24: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/24.jpg)
24
SELENIUM CORE2. Selenium
Framework d’exécution de tests DHTML
Moteur de • Selenium IDE• Selenium Remote Control
Déploiement possible sur serveur d’application
![Page 25: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/25.jpg)
25
SELENIUM REMOTE CONTROL
Selenium IDE+ Core
2. Selenium
![Page 26: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/26.jpg)
26
SELENIUM REMOTE CONTROL
Navigateur
Firefox ≥2
IE ≥ 6
Safari ≥ 2
Opera ≥ 8
Chrome
SELENIUM IDE
Enregistre et lance les tests
Exécution via RC
Exécution via RC
Exécution via RC
Exécution via RC
SELENIUM RC
Démarre le navigateur &
lance les tests
Démarre le navigateur &
lance les tests
Démarre le navigateur &
lance les tests
Démarre le navigateur &
lance les tests
Démarre le navigateur &
lance les tests
OS
Windows, Linux, Mac
Windows
Mac
Windows, Linux, Mac
Windows
2. Selenium
![Page 27: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/27.jpg)
27
SELENIUM REMOTE CONTROL
2. Selenium
.jar JRE
![Page 28: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/28.jpg)
28
SELENIUM REMOTE CONTROL
• Condition / Itérations• Dépendance de cas de test
• Historisation des résultats des tests (Framework)• Gestion des erreurs• Re-exécution des tests qui ont échoué• Capture d'écran des tests qui ont échoués
• Tests de Base de Données
2. Selenium
![Page 29: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/29.jpg)
29
SELENIUM REMOTE CONTROL
2. Selenium
![Page 30: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/30.jpg)
30
C# 2. Selenium
![Page 31: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/31.jpg)
31
2. SeleniumJava
![Page 32: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/32.jpg)
32
2. SeleniumPerl
![Page 33: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/33.jpg)
33
2. SeleniumPhp
![Page 34: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/34.jpg)
34
2. SeleniumPython
![Page 35: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/35.jpg)
35
2. SeleniumRuby
![Page 36: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/36.jpg)
36
SELENIUM REMOTE CONTROL
Options du serveur :• Configurer le proxy• Mode Mono/Multi fenêtre(s)• Choix du profil Firefox• Exécuter directement du HTML• Récupérer les logs directement• Chemin absolu vers le navigateur (ex : si plusieurs versions)• Mode interactif
Plus d’options en tapant : java -jar selenium-server.jar –h
2. Selenium
![Page 37: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/37.jpg)
37
SELENIUM GRID2. Selenium
Limitations de RC :
• Tests concurrents limités ( <6 conseillé / RC)
• Si trop rapide : Goulot d’étranglement Selenium RC navigateur
• Tests différentes versions des navigateurs & OS.Architecture compliqué et non maintenable
![Page 38: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/38.jpg)
38
SELENIUM GRID2. Selenium
![Page 39: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/39.jpg)
39
SELENIUM GRID2. Selenium
![Page 40: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/40.jpg)
40
SELENIUM GRID2. Selenium
![Page 41: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/41.jpg)
41
SELENIUM GRID2. Selenium
Avantages : • Améliorations des performances• Limitation de l’utilisation de chaque RC• Choix du RC transparent (hub)• Tests multi navigateurs & multi OS faciles
Exemple en javanew DefaultSelenium("localhost", 4444, **'*firefox'**, 'http://www.google.fr');
devientnew DefaultSelenium(”hub", 4444, **Chrome on Ubuntu'**, ‘http://www.google.fr ');
new DefaultSelenium("hub", 4444, ** IE 7 on Chinese locale '**, ‘http://www.google.fr ');
new DefaultSelenium("hub", 4444, ** Safari on Quadri-processor '**, ‘http://www.google.fr ');
![Page 42: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/42.jpg)
42
SELENIUM ON RUBY & ON RAILS2. Selenium
![Page 43: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/43.jpg)
43
CUBIC TEST (POUR ECLIPSE)
2. Selenium
![Page 44: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/44.jpg)
44
CUBIC TEST (POUR ECLIPSE)
2. Selenium
![Page 45: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/45.jpg)
45
CUBIC TEST (POUR ECLIPSE)
2. Selenium
![Page 46: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/46.jpg)
46
CUBIC TEST (POUR ECLIPSE)
2. Selenium
![Page 47: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/47.jpg)
47
CUBIC TEST (POUR ECLIPSE)
2. Selenium
![Page 48: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/48.jpg)
48
CUBIC TEST (POUR ECLIPSE)
2. Selenium
Fonctionnalités de IDE + Core + RC (php et java)
Couche Graphique
Watir ?? (Partie 3)
![Page 49: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/49.jpg)
49
BROMINE2. Selenium
![Page 50: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/50.jpg)
50
BROMINEReporting : utiliser des Frameworks
• Java• JUnit Report• TestNG Report• ReportNG • TestNG-xslt
• Python• HTMLTestRunner
• Ruby• RSpec Report
Ou : utiliser Bromine !
2. Selenium
![Page 51: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/51.jpg)
51
BROMINE2. Selenium
Application under tests
ManagersDéfinissent les tests requis et les scénarios de testsConsultent les résultats
TestersUpload et lancent les testsConsultent les résultats
![Page 52: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/52.jpg)
52
BROMINE2. Selenium
• Tests en Java et Php
• Enregistrement possible avec IDE
• Upload de tests
• Tests multi navigateurs & OS en un click
• RCs sous forme de Nodes (sans GRID)
• Logs des résultats
• Groupes Projets
• Plugins
![Page 53: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/53.jpg)
53
SELENIUM : BILAN2. Selenium
![Page 54: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/54.jpg)
54
SELENIUM : BILAN2. Selenium
Fonctions de bases
Tests multi plateformes/OS
Approche projet
Couche graphique
Utilisateurs de Ruby
![Page 55: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/55.jpg)
55
WATIR3. Watir
Open source
Communauté active et grandissante
Ruby
Multi plateforme / OS
"Powerfull""easy to use" "beautifully lightweight"
![Page 56: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/56.jpg)
56
WATIR3. Watir
Automated testing that doesn’t hurt
sudo gem install
![Page 57: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/57.jpg)
57
WATIR3. Watir
#sudo gem install xxxxxxxx
![Page 58: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/58.jpg)
58
CONCLUSION 1/2Nouvelle approche des tests d’interface web
Mon choix : Selenium
• Adapté à différents niveaux de besoins• Multi langages
Mon avis : Watir
• Adapté à un seul un seul niveau de besoin• « La terre ne s’est pas faite en un jour »
![Page 59: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/59.jpg)
59
CONCLUSION 2/2
Selenium : Compatible avec Spring Roo
Des betas coté Selenium…• Tests sous Android• Selenium Standalone
(RC + WebDriver en un jar)• Selenium 2
(WebDriver)
http://code.google.com/p/selenium/downloads/list
![Page 60: Outils d’automatisation de tests d’interfaces Web David GERBAULT Ingénieurs 2000](https://reader030.vdocuments.fr/reader030/viewer/2022032710/56813b37550346895da4099f/html5/thumbnails/60.jpg)
60
Le Chat de Philippe Geluck
QUESTIONS ?