In Previous Step, We have Implemented URL centralization In DDF to make your future URL maintenance easy and you can change test site URL from one place. Now next step Is to write some WebDriver test code. In this step We will Implement simple calc test In our SuiteOneCaseOne.java test case.
Prerequisite : WebDriver DDF creation steps from Step 1 to Step 25 should be Implemented. You will find links for all steps on this MASTER PAGE.
For What This Test Is
This Is very simple calc test to Sum three Integer values. It will use excel file's test data sheet's data to build the xpath of calc buttons. In short, We will use excel sheet data In our webdriver test case to perform some action on page and get the result.
Download Required Files
Right now, we will Implemented this test only In SuiteOneCaseOne.java test case file. Letter on, We will Implement It In all test cases. For now, you have to download SuiteOneCaseOne.java file. Download bellow given zip folder to get SuiteOneCaseOne.java.
Replace existing SuiteOneCaseOne.java file with downloaded file In "com.stta.SuiteOne" package.
Double click on "Shortcut to Run Test.bat" file on desktop. It will start running your test cases. During SuiteOneCaseOne.java test case execution, Webdriver will click on calc buttons as per data set lines values of SuiteOneCaseOne excel sheet.
If you will see log file, It will show you data set line's sum as shown In bellow given Image.
What we have achieved from this step
We have used test data from exel sheet to perform actions on calc application using selenium webdriver data driven framework.