Merken

Effectively test your webapp with Python and Selenium

Zitierlink des Filmsegments
Embed Code

Automatisierte Medienanalyse

Beta
Erkannte Entitäten
Sprachtranskript
the OK so let's welcome and they come on and he'll tell tell us about testing the web application with selenium be without mn this working at all so that be testing that we test aware of Python splenium that's a mouthful right on so what this talk actually
about of I've been working on a project for a a prolonged time now and I don't see you from its beginnings how all over the product itself the ball like the code base and how just around the evolve because we are of reach some conclusions at some point in time and we try to prove what they have power and that's what I want to share with you guys flavor of what we learn from that and there are hoping that you don't make the same mistakes that you the course OK so my name is
on the phone 1 I'm from things like that so senior Romanian was Romanian of and work at 3 villa form of PBS that's the public broadcast system in the US you can find me a thanks to my code on github mobile phone and How would you guys and many of you have been working on something in look quite a lot of how many of you are like 280 something unit test something I could not less so it's not some bad things on so what what's the recognition and Our can have like I like to think of that of like the way the tests involved in 3 phases and were around people of each space and C are what we believe right each phase with or not so good and how we try iterate over that in that space yeah for so this is how
best to look like in the 1st phase of the mind and this is then like in the beginning of the project where security and have that much more for development because we were like front of the features of so this is what I rope but the test looks like this greater resources and results but what post something of given title from previous studies on and then we had a test and use that particularly source nothing out of the ordinary so political of the power of the page on the model selenium life so of we work with kids and we separated the selenium interactions from the test itself so we have like stage of model classes that model page and at the time we're using XPath so to get the title we were doing like getting there and going up by specific and you know go a level of something it was confusing right so with this this was hiding actually that part of the time we're using knows the center of as of test from and knows that's when it starts collecting your test by default it runs them in alphabetical order so if C goes before we our user test kind of like or means to create a fixture in the state from the test on the server and then does that allow and different tests you can see how that can and doesn't scale and contradicts some of the practices of keeping tests separated and of independent of and this year this is the year of that the problem with the way we is selenium so we use the data from all that was called but we had this really long necks of mixed may have heard of 100 readers and that of whenever a developer came and unknowingly and change the way the channel structure for a specific stage while that's about that tests that were open and so all these tests were running like on our environment for the argument that they were under some production around this QA some stage but the I can imagine that it for all the test were feeling like it's not that cool that you left the leftovers on production so yeah resistance and better we 1 of want to stop using test says feature generators of 1 of moved to something more robust in terms of identifying selenium element interacting with it being getting being of getting its value for of interacting with that element that's what click on something so I think it's time
to upgrade it to general 1 4 and then we have like sort of test case only said galaxy that a shot finance and then solve all the problems with setting of fixtures imagine we went away because we will using the gender or and create like this state we remember that and of of using test and there's a do targeted of that the CDO and this is the title of the page or I can click on the specific environment individual players and stuff like that and we weren't stock and that's all that kind of end-to-end test for a to create something the using the and and then tested using the of the published data so this is like a better world for for us right we can run test independently wouldn't paralyzed which we can do of whatever many headaches before this is good right so we also take note of how we were handling selenium integration and started moving to Europe something more specific so we started looking into new ideas for successful actors and activists are also more readability into the over you know it's going to be an idea called title and uh it was also less brittle because once you moved like sections of HTML and you can't wait it's not as likely to break the tests with that the
so what's the problem with this kind of approach that it's not a single environment now when you get an e-mail in the middle of the day saying that OK we are team that's all Europe climbed of so like we have on the team of managers image ingestion fantasizing right and if they make a deployed a kind of misunderstanding of their rights and that's the nature of your production environment still works all you can use these tests for that kind of thing because these tests spin up like a really bare-bones environment you just create just enough data to do your test and and afterwards it's only way in the narrative designed to law test real environment whereas in the previous approach we were actually testing by QA collection and so on called but
this is a good thing that and on page of models are using a these but but then again we could do a bit better here to OK so what we
have and what we want do better after all these 2 phases were separated long-running test 4 tests is still like to have but can't testing goal maybe to multiple parts of the application and does the workflow but maybe you something like if you have a blog and just check that the specific page works that's good enough for like a smoke test Google this so and how will test software and they have like a section where they and chunk tests in medium small large extra large and small tests are unit vulva brands on the machine the largest as more like these integration tests and all the next large would be like Amendment test it's important to put the a distinction between these and for time boxes in which all of the tests we like all my large test was 1 of the 5 minutes of running them and their independently that's kind of a conflict between the 1st phase and 2nd phase of the 1st phase we can run them independently but we could use environment the 2nd phase new random independently but weren't hitting any real environment and so on he started looking
around of mention losing knows tests but practice schools like you cannot go off and make sense of try to look at what that has to offer will we put a limit on our selenium policies like in our test set of faster running on their 5 5 minutes 5 continents previously your selenium or was running in in 45 minutes and in the 1st of iterations so in the 1st phase was really hot the ball so if you want to know if they would like interview part you have to go through all the creation and there was a very cumbersome and hard efforts to the book so we also what we wanna to make emphasis on is the coupling the test from the additional structure of the page and from this the 1 with the lumen Stepford further from of hooking so identifying elements from existing processes so that there is sort of new ideas in the page to setting up a combination between the development team and the 218 saying hey this is of prefix which although identifier so here if you have a class like selenium dashed something that's reserved for testing so for allowing gasses to hook up to to that identify that element and do stuff with it's important not the time any the assessment of functionality that because you're just going to call it's important to keep in mind that the those test folks of focused only on the so called how does just look like and now nowadays the page is pretty much the same except that we have this stuff like selenium prefix everything so but you don't go in and rely on our own ideas of CSS classes that will put on developers and maybe make that specific government-led on top of something and and also we kept the same page after the model and the world it's pretty much and that's why is
because we switch to quite of started using the a couple of interesting plug-ins from the Mozilla Foundation and quality of resources of all of the above incident showcase the the latent presentation on but they're really helped us to go around or on the a new test so 1 of the 1st 1
instead of a tried out was as variables this is something that you can put on your project and keep like a fixture in of credentials something that produce some file menu past that and and the test suspended separation of fiction made up your nationals from the from the itself and has a principal interface critical for our of guys of socialist was the 1st
place HTML so full blood and that was not necessarily tied to selenium integration but provides you like for the test report saying of pages that field here and these are the values that is filled out a lot and if you are using it in conjunction with the widest each channel the vitally important from the middle of the rise but also and that's a screenshot from 1 of the best thing this report the selenium this is on by the Mozilla Foundation open open-source recalled has lot from drivers all I will drive a story from Firefox of from we initially Ronald tests on Firefox and and the switching from the sort of significant performance improvement of and it was pretty cool at this point allowed us just a change of parameter somewhere in that all artists were like running on a promise that most of the powerhouse for for connecting with close to this testing services light source of the resistor yeah yeah that's what I think for chromium means and Solectron library and that value just almost selenium package in your environment
OK so 1 of the thinking through because they were from the talk this a more refined do on the project going forward is averaging 8 years to create data fixtures so if you have like arresting to create stuff and removed from error of from Iraq further leveraged at you know like creating a blog posts and the needed for the purposes of adding additional metadata into Europe of interphase so these are there in that connection between the development of QA everything prefixed with something Slovenian meat whatever man or whatever you want and last but not least defined like these test classes so will will have large does have small tests and that the time boxes around them and 1 that I when specific class exceeds that time box you really should look at feeling that for class possible looking at y all of a sudden my hold large test cases like maybe small test see it's running slow before will the ability and you would find few and questions do you know of an easy way to get a video recording of the runs not to really I haven't played around adapt yeah that's an interesting point of alternative for the Mozilla problem maybe a day after that it's not needed it's something worth contributing to open source I know in past what would our previous company we were using against to the full beta with core test runs this why it the to answer the previous question I know about Motorola has something because they don't use reducing pairs patterns HTML so maybe it's just checked that the condition for adapt to hop outputs so command the development issue and then maybe it will be the any other questions the and have you looked into splinter at all and pi tests winter plug-ins are you haven't answered convenience rapid library in Python for selenium which helps you write better and asserts without going into the market so it's like instead of putting . this yellow mark everywhere it helps you to write better tested unless so just things that it makes it easier to write messages equal I'm curious about something about the that asterisk thanks I have to use versions your page objects if you're making changes then In the application in the health deal with having different versions of and that regression testing with the bonds so our what prime now it trying to get an element and if you can get that took element you skip that tests and our market basket can see stated in this as escape until that code which is that the environment different test need any other questions OK if is the that that's all I would say thank you thank you thank you
Metropolitan area network
Softwaretest
Rechter Winkel
Web-Applikation
Computeranimation
Softwaretest
Softwareentwickler
Punkt
Komponententest
Physikalisches System
Mustererkennung
Biprodukt
Broadcastingverfahren
Code
Raum-Zeit
Computeranimation
Software
Bildschirmmaske
Projektive Ebene
Phasenumwandlung
Leistung <Physik>
Resultante
Server
Element <Mathematik>
Klasse <Mathematik>
Zeichenvorrat
Interaktives Fernsehen
Aggregatzustand
Element <Mathematik>
Term
Computeranimation
Datensichtgerät
Homepage
Übergang
Homepage
Informationsmodellierung
Softwaretest
Vorlesung/Konferenz
Generator <Informatik>
Datenstruktur
Softwareentwickler
Default
Phasenumwandlung
Leistung <Physik>
Beobachtungsstudie
Softwaretest
Umwandlungsenthalpie
Zentrische Streckung
Videospiel
Parametersystem
Division
Computersicherheit
Quellcode
Objektklasse
Biprodukt
Quick-Sort
Integral
Generator <Informatik>
Menge
Rechter Winkel
Ein-Ausgabe
Mereologie
Server
Garbentheorie
Projektive Ebene
Ordnung <Mathematik>
Programmierumgebung
Baum <Mathematik>
Aggregatzustand
Softwaretest
Bit
Element <Mathematik>
Natürliche Zahl
Singularität <Mathematik>
Objektklasse
Gesetz <Physik>
Computeranimation
Homepage
Homepage
Informationsmodellierung
Softwaretest
Datenmanagement
Rechter Winkel
Reelle Zahl
Reelle Zahl
E-Mail
Programmierumgebung
Bildgebendes Verfahren
Quader
Web log
Element <Mathematik>
Klasse <Mathematik>
Schaltnetz
Versionsverwaltung
Iteration
Kartesische Koordinaten
Element <Mathematik>
Computeranimation
Homepage
Homepage
Virtuelle Maschine
Informationsmodellierung
Softwaretest
Einheit <Mathematik>
Software
Hook <Programmierung>
Inverser Limes
Vorlesung/Konferenz
Passwort
Softwareentwickler
Datenstruktur
Stochastische Abhängigkeit
Parallele Schnittstelle
Phasenumwandlung
Softwaretest
Lineares Funktional
Programmierumgebung
Objektklasse
Quick-Sort
Integral
Rückkopplung
Zustandsdichte
Menge
Login
Ein-Ausgabe
Mereologie
Identifizierbarkeit
Garbentheorie
Programmierumgebung
Baum <Mathematik>
Ext-Funktor
Softwaretest
Trennungsaxiom
Offene Menge
PASS <Programm>
Plug in
Kombinatorische Gruppentheorie
Elektronische Publikation
Inzidenzalgebra
Variable
Computeranimation
Homepage
Variable
Softwaretest
Mittelwert
Punkt
Web log
Desintegration <Mathematik>
Versionsverwaltung
Schreiben <Datenverarbeitung>
Kartesische Koordinaten
Element <Mathematik>
Festplattenrekorder
Computeranimation
Homepage
Metadaten
Softwaretest
Lineare Regression
Maskierung <Informatik>
Mustersprache
Information Retrieval
Vorlesung/Konferenz
Metropolitan area network
Funktion <Mathematik>
Softwaretest
Addition
Parametersystem
Arithmetisches Mittel
Quader
Dienst <Informatik>
Projektive Ebene
Programmierumgebung
Message-Passing
Fehlermeldung
Subtraktion
Quader
Mathematisierung
Klasse <Mathematik>
Dienst <Informatik>
Code
Programmbibliothek
Äußere Algebra eines Moduls
Softwareentwickler
Einfach zusammenhängender Raum
Open Source
Betafunktion
Plug in
Quick-Sort
Integral
Objekt <Kategorie>
Druckertreiber
Differenzkern
Offene Menge
Speicherabzug
Verkehrsinformation
Benutzerführung

Metadaten

Formale Metadaten

Titel Effectively test your webapp with Python and Selenium
Serientitel EuroPython 2016
Teil 108
Anzahl der Teile 169
Autor Coman, Andrei
Lizenz CC-Namensnennung - keine kommerzielle Nutzung - Weitergabe unter gleichen Bedingungen 3.0 Unported:
Sie dürfen das Werk bzw. den Inhalt zu jedem legalen und nicht-kommerziellen Zweck nutzen, verändern und in unveränderter oder veränderter Form vervielfältigen, verbreiten und öffentlich zugänglich machen, sofern Sie den Namen des Autors/Rechteinhabers in der von ihm festgelegten Weise nennen und das Werk bzw. diesen Inhalt auch in veränderter Form nur unter den Bedingungen dieser Lizenz weitergeben
DOI 10.5446/21097
Herausgeber EuroPython
Erscheinungsjahr 2016
Sprache Englisch

Inhaltliche Metadaten

Fachgebiet Informatik
Abstract Andrei Coman - Effectively test your webapp with Python and Selenium How often do you run your Selenium test suite? How fast do you get a result from it? Would you like to answer with: "Whenever I feel like it" and "Well, about the time it takes me to finish a coffee" ? This talk will try to get you closer to these answers. We will have a look at the lessons learned and the challenges my team faced maintaining a Selenium test suite against a long-lived Django web application. We will go over the pros and cons of: - test design approaches - technologies we used (nose, py.test, LiveServerTestCase) - reporting tools

Ähnliche Filme

Loading...