1 / 21

Automatisation

Automatisation. Plan: Avantages et Inconvénients Exemple de logiciels d’automatisation Exemple de fonctions Exemple d’automatisation d’un test. Automatisation. Plan: Avantages et Inconvénients Exemple de logiciels d’automatisation Exemple de fonctions

hannelore
Télécharger la présentation

Automatisation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Automatisation • Plan: • Avantages et Inconvénients • Exemple de logiciels d’automatisation • Exemple de fonctions • Exemple d’automatisation d’un test Automatisation

  2. Automatisation • Plan: • Avantages et Inconvénients • Exemple de logiciels d’automatisation • Exemple de fonctions • Exemple d’automatisation d’un test Automatisation

  3. Automatisation:Avantages et Inconvénients • Avantages de l’automatisation: • Meilleur couverture de l’application: • Exécution de plus de tests automatiques que manuels en un même intervalle de temps. • Minimiser les problèmes de non régression => Focalisation des tests manuels sur les nouvelles fonctionnalités • Meilleur fiabilité de l’application • Meilleur couverture • Stabilité du produit • Résultat rigoureux • Pas d’intervention humaine Automatisation

  4. Automatisation:Avantages et Inconvénients • Avantages de l’automatisation: • Gain de temps • Exécution rapide • Concentration sur l’analyse du problème • Détection rapide des problèmes (bugs) • Gain de temps pour la livraison Automatisation

  5. Automatisation:Avantages et Inconvénients • Inconvénients de l’automatisation: • Coût pour la mise en place • Contrainte sur l’écriture du test • Le test doit être robuste => même après une modification de l’interface graphique. • On ne peut automatiser l’application dès lors qu’on connait l’ interface graphique • => Plus facile d’écrire un test manuel qu’un test automatique Automatisation

  6. Automatisation • Plan: • Avantages et Inconvénients • Exemple de logiciels d’automatisation • Exemple de fonctions • Exemple d’automatisation d’un test Automatisation

  7. Automatisation:Exemple de logiciels • Logiciels d’automatisation de tests fonctionnels • Editeur Mercury: • Winrunner (langage utilisé se rapproche du java) • Quick Test Pro (langage utilisé se rapproche du VBScript) • Editeur Seapine Software: • QA Wizard • Editeur Borland: • SilkTest Automatisation

  8. Automatisation • Plan: • Avantages et Inconvénients • Exemple de logiciels d’automatisation • Exemple de fonctions • Exemple d’automatisation d’un test Automatisation

  9. Automatisation:Exemple de fonctions • Attendre l’apparition d’une page • Fonction « sync »Browser("Browser").Page("Air France").Sync • Vérifier la présence d’un objet • Fonction « exist »QTP: Browser("Browser").Page("billet avion").WebList("aeroport").Exist Browser("Browser").Page("billet avion").WebEdit("aeroArr").ExistWinrunner:obj_exists (strObjChecked, 10); Automatisation

  10. Automatisation:Exemple de fonctions • Récupérer les propriétés d’un objet • Fonction « GetROProperty »Browser("Browser").Page("billet avion").WebList("aeroport") .GetRoProperty(« name")=> On récupére le nom de l’objet « aeroport »Browser("Browser").Page("billet avion").Link("GoTo") .GetRoProperty("href")=> On récupére la cible du lien « GoTo »Browser("Browser").Page("billet avion").WebButton("submit") .GetRoProperty("value")=> On récupére le nom afficher pour le bouton « submit » Automatisation

  11. Automatisation:Exemple de fonctions • Condition et boucle • Fonction « If »QTP:If (Browser("Browser").Page("billet avion").Exist) then Browser("Browser").Page("billet avion").WebButton("valid").Clickelse if( …)thenelse …End ifWinrunner:if (obj_exists(« billet avion »,5)){web_image_click(" valid", 1, 1);else …;} Automatisation

  12. Automatisation:Exemple de fonctions • Condition et boucle • Fonction « while »QTP:While(not Browser("Browser").Page("billet avion").Exist and i < 10) wait(1) i = i + 1WendWinrunner:while (obj_exists(“billet avion”)&& i<10){wait(1);i ++;} Automatisation

  13. Automatisation:Exemple de fonctions • Case • Fonction « case »QTP:Dim varSelect Case var Case « rouge » ‘Instruction Case « vert » ‘Instruction Case else ‘InstructionEnd selectWinrunner:Switch(var){ case “rouge” #Instruction break; case “vert” #Instruction break;} Automatisation

  14. Automatisation:Exemple de fonctions • Création du rapport • Fonction « Reporter.ReportEvent [Statut],[StepName],[Detail] »QTP:If (Browser("Browser").Page("billet avion").Exist) then Reporter.ReportEvent micDone, "Résa", "OK"else Reporter.ReportEvent micFail, "Résa", "KO"End if • Statut peut être égal à "micDone", "micPass", "micFail", "micWarning«  • Winrunner:if(obj_exists(« billet avion »,5)){tl_step(“Résa",passed,”OK”); • Else tl_step (« Résa »,failed, « KO »);} Automatisation

  15. Automatisation • Plan: • Avantages et Inconvénients • Exemple de logiciels d’automatisation • Exemple de fonctions • Exemple d’automatisation d’un test Automatisation

  16. Automatisation:Exemple de tests automatiques • Etapes de création d’un test automatique par le logiciel Quick Test Pro: • Enregistrement d’un scenario pour permettre de créer un bibliothèque d’objets (« object repository ») (cf vidéo) • On obtient donc un code comme ceci: • «Browser("Browser").Page("Page").Sync • Browser("Browser").Navigate "http://www.airfrance.fr" • Browser("Browser").Page("billet avion : Air France").WebEdit("aeroportArrivee").Set "toronto" • Browser("Browser").Page("billet avion : Air France").WebList("jourAller").Select "15" • Browser("Browser").Page("billet avion : Air France").WebList("moisAller").Select "septembre" • Browser("Browser").Page("billet avion : Air France").WebList("jourRetour").Select "20" • Browser("Browser").Page("billet avion : Air France").WebList("nbPassagers").Select "2" • Browser("Browser").Page("billet avion : Air France").WebList("typoPassagers").Select "Etudiant Majeur (25 - 26 ans)" • Browser("Browser").Page("billet avion : Air France").Link("rechercher").Click » Automatisation

  17. Automatisation:Exemple de tests automatiques On peut modifier les propriétés qui permettront de retrouver l’objet dans la page web: Automatisation

  18. Automatisation:Exemple de tests automatiques On peut paramétrer la valeur des objets: Browser("Browser").Page("billet avion : Air France").WebList("aeroportDepart"). SelectEnvironment("Dest_Aeroport") Au lieu de: Browser("Browser").Page("billet avion : Air France").WebList("aeroportDepart"). Select(« Nice ») Automatisation

  19. Automatisation:Exemple de tests automatiques • Modification du test ainsi enregistré pour le rendre plus robuste et modulableExemple du code: • «Adresse • Browser("Browser").Page("Page").Sync • Browser("Browser").Navigate "http://www.airfrance.fr" • 'Attendre que la page soit apparue • Dim i • while(not Browser("Browser").Page("billet avion : Air France").Exist and i < 5) • wait(1) • i = i+1 • wend • if(Browser("Browser").Page("billet avion : Air France").Exist)then • reporter.ReportEvent micPass,"Page accueil AirFrance","OK" • else • reporter.ReportEvent micFail,"Page accueil AirFrance","KO" • ExitRun(0) • end if • 'Element de recherche • Browser("Browser").Page("billet avion : Air France").WebList("aeroportDepart").Select Environment("Depart_Aero")» Automatisation

  20. Automatisation:Exemple de tests automatiques • 2 Exemples de tests finis • 1ierexemple: 1 passager Paris-Toulouse • 2ieme exemple: 2 passagers Paris-Nice Automatisation

  21. Automatisation Merci pour votre attention Automatisation

More Related