Skip to content

Latest commit

 

History

History
145 lines (130 loc) · 7.36 KB

README.md

File metadata and controls

145 lines (130 loc) · 7.36 KB

An automation framework for performing automation testing of Web Applications using Selenium.

Version : 0.0.12

How to Use

Build and Run

  1. Download Source zip or git clone the repository
  2. Import into your JAVA work-space
    • Run maven install to install dependencies
  3. Configure the run configuration to pass in data file path as argument
  4. Create a test script data file
    • Create data file that hosts configuration, execution list and test cases.
    • Refer wiki on how to create test case file, which has the required format for execution.
  5. Launch a selenium grid server with browser instances
    • Refer Examples - Grid_Script for launching selenium grid with Firefox and Chrome instances.
  6. Run the Main class
  7. Verify the test execution report generated by the framework
    • Result report is generated in reports folder

Framework Capabilities

  • Element Location:
    1. Name - Finds an element using HTML name
    2. TagName - Finds an element using the tag name
    3. CSS - Finds an element using CSS path
    4. XPATH - Finds an element using XPath
    5. ID - Finds an element with HTML ID
    6. LinkText - Finds a link/anchor element using exact text
    7. PartialLinkText - Finds a link/anchor element using partial text
  • Available Actions:
    1. General Functions:

      • Wait - Waits for user defined seconds
      • Javascript - Executes a JS statement
      • Run - Runs another test case as boxed within an execution
      • SwitchTo - Switches to another window
      • SwitchToParent - Jumps back to parent window
      • Evaluate - Evaluates a mathematical expression (Uses Browsers JS Runtime) and returns the value
    2. Web Element Functions:

      • Count - Count the number of web elements
      • isDisplayed | isPresent - Verify if a web element is displayed
      • isEmpty - Verify if a web element is empty
      • isNotDisplayed | isNotPresent - Verify if a web element is not displayed
      • hasAttribute - Verify if a web element has a specific attribute
      • hasNoAttribute - Verify if a web element does not have a specific attribute
      • GetAttribute - Get the specified attribute of a web element
      • Input Specific Functions
        • Input - Send string value to a web element
        • Clear - Clear a web element
        • Send - Send special key combinations like Ctrl+C, Enter, etc.
      • Mouse Specific Functions
        • Click - Click on a web element
        • Right Click - Right-Click on a web element
        • Hover - Hover over a web element
        • Drag And Drop - Drag and drop a web element to another web element
        • MouseDown - Sends a mouse down event to element
        • MouseMove - Sends a mouse move event to element
        • MouseUp - Sends a mouse up event to element
      • Check-Box Specific Functions
        • isChecked - Verify if the check box is checked
        • isNotChecked - Verify if the check box is not checked
      • Select-Box Specific Functions
        • SelectByText - Select option by text
        • SelectByValue - Select option by value
        • SelectByIndex - Select option by index
    3. Run-Time Utility Functions

      • Save - Save Text or Value attribute of an element to run-time variable
      • Match - Match the Text or Value of an element to stored run-time variable
      • Equal - To check equality of 2 variables
      • NotEqual - To check inequality of 2 variables
      • Print - Prints out text, value or string to console
    4. Assertion Functions

      • Assert [Default] - Default assert without any parameters will assert Text of an element
      • Assert [URL Over-ride] - URL Over-ride will assert the URL of the page
      • Assert [Misc Param Over-ride] - Over-ridden assert will assert the Parameter value of an element
    5. Driver Functions

      • Close - Closes the current window
      • Quit - Quits the browser instance
      • Open - Open a new browser instance
      • Open/Get - Open a new browser instance and get the URL
      • Get - Get a URL
      • AcceptAlert - Accept an alert box

Internal Working

  • Reader package reads the data file and extracts the test execution configuration, test execution management and test cases.
  • Executor package executes the scripts and provides interim results
  • Reported package prints the results in user readable format (HTML document)

Dependencies

  • jxl.jar - v2.6.12
  • selenium-server-standalone - v2.51.0

Road Map

  • Adding advanced selenium functions - In-Progress
  • Create an executable
  • Better Errors
  • Email configuration for report delivery
  • Upgrade to Object repository
  • Basic selenium functions
  • Reporting
  • Using results from execution module in reporting module
  • Take screenshot in case of step failure
  • Adding assertion checks
  • Allow providing data file path from command line / run config
  • Better Reports
  • Error focus in screenshot

Change Log

  • 24/02/2016: Adds hasAttribute & hasNoAttribute actions
  • 11/02/2016: Updated project setup to be a Maven project
  • 17/07/2014 : Moved JAR to other repo, for the time being, clone git and build to use
  • 15/07/2014 : BREAKING CHANGES
    • [New Feature] : All the elements will now be looked up from Object Repository sheet
    • [Enhancement] : Documenting methods
    • [Enhancement] : Restructuring packages
  • 14/07/2014 :
    • [New Feature] : Evaluate functionality
    • [New Feature] : Print functionality
    • [New Feature] : Window handling
    • [Enhancement] : Attribute assertions
    • [Enhancement] : Code refactored
    • [Bug Fix] : Catch error of empty execution and report hashes
    • [Bug Fix] : Catch error of AJAX listener for sites not using jQuery for XHR
  • 27/06/2014 : Refactored selenium file code, added 'Equal','isChecked','isNotChecked', fixed javascript action
  • 25/06/2014 : Added select box option saving, assert can also use run-time variable data, bug fix in run-time lookup
  • 18/06/2014 : Error handling for missing parameter, option to skip a test step
  • 13/06/2014 : Added selenium functions for Select box, reworked error filename, reword error message in html report, added functionality to run command to allow step removal from front & back
  • 12/06/2014 : Added total test cases description while reading, fixed multiple module detail tab report bug, sorting test cases in report, fixed click - Scroll into view only if element out of viewport
  • 11/06/2014 : Refactored code, added Save/Match functionality, added error focus on web element, uses Selenium-2.42.2
  • 10/06/2014 : The result report now organize the test cases in accordians with status as the header color, reworked URL assert
  • 06/06/2014 : Created JAR executable, added Selenium Grid by default, AJAX listeners, command line argument for Data file
  • 04/06/2014 : Added more selenium funtions, restructured error handler for Action - Assert
  • 02/06/2014 : Restructured executor to remove if/elsifs and use switch for action types.
  • Undocumented : Reworked Reading and Executing for allowing user to reuse existing test case within another test case.