Details - snehalmasne/Selenium-Utility GitHub Wiki

Directory Structure

  • Lib: Lib folder contains all the library files. Ex: Selenium, ReportNG..etc
  • TestData: This folder will have all the Test data files
  • Test Scripts: This folder will have all the scripts and function Libraries.
  • Test Suites: This folder will have all the test suites.
  • Test Results: All the test results will be stored in this directory.
  • Build.XML: This is ANT build file which will hold everything together and executes commands.
  • Run_Server.bat: Running this batch file will run the selenium server.
  • RunTest.bat: This batch file will run the build file which will compile, execute and saves the results.

Steps to implement an Automated Test Script:

  • Identify a module you need to Automate
  • Write scenarios and prepare test data
  • Identify the scenarios that can be automates
  • Record the test scenarios/test case using Selenium IDE
  • Save the test case into Test Scripts folder
  • Follow the Test Script standards and modify the test case to insert functions, loops, conditions and to apply the data driven
  • Create or update the Test Suite and include the test case in that
  • Test the scripts: Execute the tests by running the Run_Server.bat and RunTest.bat files.
  • If test script is running without any issues submit for code review or upload it to StarTeam

Test Scripts

  • Separate the Test Data from the script. Test data should be included in XML file and save the XML Test data files under “TestData” folder.
  • Try to make the script as small as possible. Make sure to follow the naming convention and other coding standards.
  • Try to write functions for each step so that it will look simple and easy to read.
  • Utilize the loops, functions and arrays where you need to repeat the steps..
  • Libraries: Commonly used functions (across all the scripts) should be placed in common Libraries under “libraries” folder