How infosys/selenium-testing-automation-framework works
Project type and purpose
• This is an open-source, data-driven test automation framework (“Selenium OSTAF”) built in Java/Maven that uses TestNG, Excel spreadsheets, and Selenium WebDriver to drive browser‐based tests without writing code for each script.
Main components of the system
a. Launcher/Entry Point
• MainTestNG (invoked via java -jar SeleniumOSTAF-*.jar)
• testng.xml
b. Configuration Reader
• ReadConfigProperty reads config.properties (app URL, browser, driver path, Excel paths)
c. Data Sources
• TestSuite2.xlsx – list of test case names + YES/NO flags
• TestCases2.xlsx – sheet “TestCase” (test steps) and sheet “CapturedObjectProperties” (locator definitions)
• driverserver.exe (external browser driver)
d. Excel Handling Layer
• ExcelLibrary / ExcelAction (POI wrappers)
• ReadExcelSuite (reads TestSuite sheet)
• ExecuteTestCases (orchestrates reading and dispatching each TestCase)
e. TestNG Execution Engine
• MainTestNG calls TestNG, passing testng.xml
• TestNG orchestrates test classes in actions package
f. Action Modules (actions package)
• FileDownloadTest, CheckFileHash, FileDownloader (example test actions)
• HashType, MethodType (enum definitions of operations)
g. Model Objects (model package)
• TestCase, CapturedObjectPropModel, MethodParameters (hold data for each test step)
h. Selenium Wrapper
• WebDriverClass (instantiates WebDriver per config)
i. Utility Services (util package)
• Logger, Report (custom logging & reporting)
• TestListener (TestNG listener for events)
• SwingTest (optional UI)
j. External System Under Test
• The web application accessed via URL
Relationships and data flow
1. User invokes JAR → MainTestNG
2. MainTestNG → ReadConfigProperty loads environment settings
3. ExecuteTestCases & ReadExcelSuite read TestSuite2.xlsx → determine which TestCases to run
4. For each enabled TestCase:
a. ExcelAction/ExcelLibrary read TestCase steps & CapturedObjectProperties → instantiate Model objects
b. TestNG executes the corresponding action class (e.g., FileDownloadTest)
c. Action Modules → call WebDriverClass → drive browser interactions or custom operations
d. Each step passes through Logger & TestListener → report events
5. Report module aggregates results → final HTML/console report
Architectural patterns & design principles
• Data-driven: test logic separated from test data (Excel sheets)
• Modular actions: each test type lives in its own class in actions
• Separation of concerns: distinct packages for models, utilities, actions
• Pluggable TestNG engine: can add/remove tests by editing Excel or action classes
• Clear component names