Git Product home page Git Product logo

octopus's Introduction

Octopus Test Automation Framework.

Octopus is a test automation framework that built in python programming language. Using Selenium and APPIUM test automation tools.

Octopus is a Hybrid test automation framework, that combines features of (Modular, Keyword Driven and Data driven).

Concepts Included:

  • Data Driven.

  • Keyword Driven.

  • Page Object pattern and Page Factory. POM

  • Common web page interaction methods.

  • Common Mobile App interaction methods.

  • Objects shared repository.

Tools

Installation

  • Install Microsoft Access database engine 2010.

  • Install Python 3.5.

  • Configure python path and pip tools.

  • Install selenium libraries using pip from command line.

pip install -U selenium

  • Install APPIUM libraries using pip from command line.

pip install Appium-Python-Client

  • Download Selenium Drivers.

Selenium requires a driver to interface with the chosen browser.

Getting Started.

lib folder:

Contains shared libraries to handle web / mobile app elements interaction and also as follow.

  • browsing .py : used to handle opening the web browser as per defined values in Test Data sheet.

  • dataManager .py : used to handle reading and updating data from excel sheet.

  • driver .py: used to handle the execution of the test by reading test cases from excel sheet, reading test data, invoking the test methods as per test data and reporting.

  • globals .py : used to create global variables in the project like [Globals.Test.Browser].

  • reporter .py : used to report the test results to html report and set the test status to pass and fail as per execution.

test folder:

Contains the test object repository (Selenium web elements) defined by using the Page Object Concept, and also the test methods to be executed.

  • Pages Folder: it contains a python module for each page from the application under test.

  • loginPage .py: in this file we are using the selenium python find by methods to define the web elements. And also write down the test methods to access these elements.

  • We are passing a data collection of type dict() that will provide test data to test methods.

  • The name of the test data variables is defined as per the name of column in the test data excel sheet.

Scenarios Folder:

Contains the test scenario methods that will be called by the driver module, these methods can combine more than one test method from different modules.

  • testScenarios. py: will be used to define our test scenario methods and we use the static method annotations to define our scenario functions.

main .py:

This module is the main entry point for the execution. We will run our project from the command line as follow.

  • open command line.
  • cd to the folder contains the main .py.
  • run the command

python main .py

Example used in this project:

We are using the login page for the jenkins web server. we defined the web elements of the login page under

test/pages/loginPage.py

Test data is defined in the excell sheet under the

Resources/TestData/ControlFile.xlsx

Browsers derives is stored under the path

Resources/ChromeDriver/chromedriver.exe

Runing the test:

  1. Define the web elements and create the test method as per the loginpage under test/pages/loginPage.py
  2. Make sure to use pass a data collection of type dictionary to the test method.
  3. define a test scenario method as per the ValidateLogin example under test/scenarios/testScenarios.py
  4. Configure the Excel Control file , Driver sheet with the name of your test scenario method as per the example under Driver sheet in file Resources/TestData/ControlFile.xlsx
  5. Define your test data as in Excel Control file , Login sheet as per the Login sheet under Resources/TestData/ControlFile.xlsx
  6. Make sure to use the column names in Login sheet to be same names you are using in the data dictionary passed to the test method.
  7. Save all you work.
  8. run the test by using the /main.py file as in previous section.
  9. The system will run the test and generate a HTML report with date and time stamp name as per the bellow example Reports/Automation_Result_20190819124044/Automation_Report_Jenkins.html

Please for more details do not hesitate to contact me at LinkedIn

octopus's People

Contributors

aelsayed85 avatar the-octopus avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.