Skip to main content

Posts

Showing posts from March, 2016

Test automation tutorial with Selenium WebDriver part 3: Test case creation

Test case creation Suppose that you need to automate simple test case: Go to http://www.openstreetmap.org Click Direction icon Type ' Berlin ' as starting point Type ' Munich ' as end point Click ' Go ' button Verify that total distance is '584km' Now we need to use this test case and write it in code using Easy Selenium UI. Development flow is simple: Generate page object for each logical part of the web page Create methods for page objects Create a test using page objects' methods and fields NOTE : Python class represents page object Let's start with class generation: Open easy_selenium_ui.py - run in cmd.exe: easy_selenium_ui.py Set root folder - folder where all data will be stored Open http://www.openstreetmap.org with Easy Selenium UI Generate class for this page Click ' Reload image ' if screenshot is not loaded Now select area that should be generated - we only need left panel Enter class name -

Test automation tutorial with Selenium WebDriver part 2: Setup

Setup This tutorials will be based around easyselenium. easyselenium is simple Selenium WebDiver wrapper written in Python. Why? - It has GUI. Tutorial will be done in Windows OS but all software can be use on MacOS and GNU/Linux as well. Needed software: Install Python 2.7 - https://www.python.org/downloads/ NOTE: Select 'Add python.exec to Path' during installation process Install pip - https://pip.pypa.io/en/stable/installing/ Download and execute https://bootstrap.pypa.io/get-pip.py Install wxPython - http://wiki.wxpython.org/How%20to%20install%20wxPython Download and install correct version for Python 2.7 and your OS(32 or 64 bit) http://www.wxpython.org/download.php#msw Install Selenium WebDriver with pip - open command promt('cmd.exe') and run command:  pip install selenium Install nose with pip - open command promt('cmd.exe') and run command:  pip install nose Install nose-htmloutput plug-in with pip - Open command p

Test automation tutorial with Selenium WebDriver part 1: introduction

  Introduction This tutorial will be about test automation with Selenium WebDriver. What you could learn: How does test automation work? Learn about Python, Python Selenium Bindings, easyselenium, nose and Jenkins Write simple test cases Learn basic git commands Learn about Jenkins Prerequisites: Interest in test automation Small understanding about testing Programming knowledge could be useful NOTE : Abbreviations can be found http://astqb.org/glossary/ How does test automation work? The flow for Test Automation Engineers: Define test case(usually taken from manual predefined test cases) Commit and push to testing repository Jenkins job executes all test cases including new one Report is generated and sent The flow for new releases of SUT: New version of SUT is deployed Jenkins job executes all test cases including new one Report is generated and sent Next: Setup