Automatr
An automation framework for performing automation testing of Web Applications using Selenium.
Version : 0.0.12
How to Use
Build and Run
- Download Source zip or git clone the repository
- Import into your JAVA work-space
- Configure the build path to include dependencies
- Configure the run configuration to pass in data file path as argument
- 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.
- Launch a selenium grid server with browser instances
- Refer Examples - Grid_Script for launching selenium grid with Firefox and Chrome instances.
- Run the Main class using the configuration defined in step 4
- Verify the test execution report generated by the framework
- Result report is generated in reports folder
Framework Capabilities
-
Element Location:
Name
TagName
CSS
XPATH
ID
LinkText
PartialLinkText
-
Available Actions:
-
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
-
-
Web Element Functions:
-
Input
- Send string value to a web element -
Click
- Click on a web element -
Right Click
- Right-Click on a web element -
Clear
- Clear a web element -
Send
- Send special key combinations like Ctrl+C, Enter, etc. -
Hover
- Hover over a web element -
Drag And Drop
- Drag and drop a web element to another web element -
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 - 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
-
-
GetAttribute
- Get the specified attribute of a web element
-
-
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
-
-
Assertion Functions
-
Assert
[Default] - Default assert without any parameters will assertText
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 theParameter
value of an element
-
-
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 - Reading and writing Excel files
- selenium-server-standalone - v2.42.2
Road Map
- Adding advanced selenium functions - In-Progress
- Better Errors
- Email configuration for report delivery
Upgrade to Object repositoryBasic selenium functionsReportingUsing results from execution module in reporting moduleTake screenshot in case of step failureAdding assertion checksAllow providing data file path from command line / run configBetter ReportsError focus in screenshot
Change Log
- 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.