Introduction
Selenium Framework and access test data advance and implement fresh tactics and tools to develop our foundation. So let’s use a sample project to learn about framework-building techniques and access the test data kept in an external source. We would then move on to describe the project hierarchy that we would be building to divide up the different project components.
To learn more about Testing Annotations in Selenium, join Selenium Training in Chennai at FITA Academy for the worthy certification and to get a good understanding of selenium concepts.
Folder structure for the Selenium project:
Selenium Framework and accessing test data
1) SRC
This folder contains test scripts, generics, readers, and utilities. These resources are all just straightforward Java classes. We have set up a hierarchy of folders under the source (src) folder.
a) Test – The “test” folder primarily consists of two components: the test suite and the directories that represent the various application modules that are being tested. As a result, the test scripts particular to each module are contained in the corresponding folders. A logical collection of multiple test scripts is called a test suite. The user can then mark the entry of any test script in the test suite they want to run in subsequent runs.
Selenium Online Training will enhance your testing skills and also gain knowledge about Selenium Automation Testing.
b) Utilities – A variety of generics, constants, Readers, and classes for implementing user-defined exceptions can be found in the “utilities” folder. Each of the utility folders has a specific purpose.
- Excel Reader – An all-purpose class called Excel Reader has been developed to read test data from Excel sheets, including input parameters and anticipated outcomes.
- EnvironmentConstants – The folder contains a collection of Java classes that include static variables referring to paths and other environmental information. This information can include the application URL, database URLs, database credentials, and URLs of any third-party tools being used. Distinct settings may use different application URLs (dev, prod, test, master, slave etc.).
- DataSetters – The folder contains the classes that carry out the getters and setters of the sample data downloaded from Excel. We develop ArrayLists to load several Test data sets.
- UserRoles – This folder houses the classes that manage any role-based access requirements for intuitive users.
2) Excel files
The Excel files are used as the test script’s data source and data supplier. The test data is saved in these files as key-value pairs. Please take note that each test script has its own test data file, which is created as a distinct excel sheet. For traceability, the names of the test script and the related test data files/Excel sheet have been maintained consistently.
3) Library
To successfully build the test environment and run the test scripts, the folder serves as a repository or is satisfactory for all the necessary jar files, libraries, drivers, etc.
4) Logs
The folder includes an a.txt file where the logging data is kept after each execution.
5) Examined materials
If any test data is required to be uploaded, it is in the folder. When we encounter test situations where the user must upload files, papers, images, reports, etc., this folder comes into play.
6) Build.xml
The “Ant Server” uses this XML file to automate the build procedure.
Conclusion
The blog mostly focused on creating a Selenium Framework and accessing test data. We used a sample project to introduce you to the Framework creation process. We briefly discussed the different parts and facets of our framework. To learn more about Selenium automation Frameworks, join Selenium Training in Coimbatore at FITA Academy for the best training with career guidance.
You can discover more about students’ experiences and our role in their learning and growth by reading FITA Academy Reviews.
Also, Read the Top 10 Selenium Automation Training Institutes in Chennai.