You are on page 1of 7

EMICalculator - ApachePOI

Grade settings: Maximum grade: 100


Based on: Selenium Reusable Execution
Run: Yes Evaluate: Yes
Automatic grade: Yes Maximum memory used: 512 MiB Maximum number of
processes: 10000

Objective:

To understand the basic excel parsing using POI and  apply the parsed data to the
web elements using Page object model

Problem Description:
An application has been designed to calculate the EMI Amount based on the
Amount, Years, and Rate of Interest

Pass the required data to the input field from Excel using Apache POI

Please refer below link for Application under test

URL:  https://webapps.tekstac.com/FormRegistration/EMICalculator.html

Test Scenario:

S.NO Actions to be performed Expected Result


1 Launch the application Application is launched
Enter the following data The show bill displays the
platform details and the ordered
Click on ‘Click on me' to purchase.
enter the name’ link and
handle the pop up

Test data: John

2 Pass the name from excel in


the popup

Amount:6000

Years:2

ROI:2
Pass the remaining input fields
like Amount,Years,ROI from
the excel

Click on the calculate emi


using calculate button and
handle the alert

Print the displayed amount in


the console

Validation rules:

All the fields are mandatory

All the input fields are numeric

Following are the java classes that contains code snippets.

DriverSetup.java Create driver (complete implementation is given for you)


Create the Page object model and required methods for
Emicalculator.java
valid scenario
Create readExcelData(String sheet Name) to read the test
ExcelUtils.java
data from excel
TestEmiCalculator.java Get the data from excel and Pass on to the input fields

Procedure to complete the case study

1. class DriverSetup is completely implemented for your reference. This class is


configured to test using Firefox browser and Firefox driver.

a) Use the method ‘getDriver’ to create a driver wherever required.

b) DO NOT CHANGE THIS CLASS

2. Class named EmiCalculator.java is already available in template code.


Hint : Do NOT remove the existing code.

Create PageObjectModel for the required webelements

Method Name Description


handle the popup and send text using
public void setName(String name)
sendkeys with 'name'
locate and fill the input box of the
public void setAmount(String amt)
'Amount' with 'amt'
locate and fill the input box of the 'years'
public void setYear (String yrs)
with 'yrs
locate and fill the input box of the 'ROI'
public void setROI (String interest)
with 'interest'
public void setCalculate() locate and submit the calculate button
public void setAlert()
Handle the alert once the calculate
button is clicked

locate the calculated amount message


public String getEmiAmount()
and return the text

3. Class named ExcelUtils.java is already available in template code.

Hint : Do NOT remove the existing code.

public static String[] Using the sheet name passed to this


readExcelData(String sheetName) method, read the data and store it in a
string array

4. Class named TestEmiCalculator.java is already available in template code.

Hint : Do NOT remove the existing code.


public void setUp() Create the driver using method
'getDriver' in class DriverSetup.

Assign it to the variable 'driver'


public static String[] getExcelData() Call the method 'readExcelData' in class
'ExcelUtils' using sheet name emi_valid
public void call the method required in class
testValidEmiCalculator(String[] 'EmiCalculator' and pass the excel data
data)
print the output in console
public void closeBrowser close the browser
main.java create the object and call the required
methods

You might also like