Here you learn through a step by step approach how to build and execute a simple test.
Test Overview - we will use Google Calculator to test a simple calculation, 2 + 3 = 5
  1. Go to www.google.com
  2. Enter "calculator" in search box
  3. Google Calculator is displayed
  4. Click 2 then + then 3 then =
  5. Result should be 5
Google Home page (www.google.com)
Search "calculator"
Calculate 2 + 3 = 5
Our approach to test Google Calculator follows the pattern described in Best Practices Creating Tests - Enterprise Level, of first building the Test Cases and then wiring them to Control Elements Here are the Steps to create and execute a Test
  1. Create a Test Case
  2. Create Test Steps
  3. Create Control Elements
  4. Create Keywords
  5. Create Test Plan
  6. Generate Test Plan
  7. Edit Test Data
  8. Execute Test Plan
  9. Review result

1. If you haven't already, launch the application by double clicking on EAFTester.exe EAF Tester Home Page

2. Click Manage...Author Test Author Test menu selection

3. The "Author Test" window opens. Data is displayed as a tree and you can expand or contract items by clicking on the triangle to the left of the tree items
Select "Version 1" under "Google Search" as shown and then click "Case" button on toolbar

4. Create a new Test Case as shown below. Enter Name (1), Description (2) and then click Add (3). NOTE: Screenshot examples incorrectly show Calendar instead of Calculator. Please use Calculator in your example.



5. The Case is added and shows up under Cases folder as shown below. We will now add the Steps for this Case. With the Case selected, click Step button (2)


6. The New Test Step window is displayed. Since the first 3 Steps for this Case exist already, we can reuse them. Click the radio button "Select from existing" [1] to bring up a selection of existing Test Steps [2]. Select "Navigate to Google" as the Step. Then click the Add button [3]. Sequence number will be automatically generated.


7. The Step is created and appears nested under the Case to which it belongs. A sequence number of 5 allows for Steps to be inserted before it if required.


8. Repeat the previous step (6) to add the other two existing Steps. Click Step button in Toolbar and in the New Test Step window, click radio button "Select from existing", then select "Enter Search Text" and click "Add" button. Do the same for "Click Search" Test Step. When you are done, your Test Case should look like the below image:


9. Now we need to create the remaining Test Steps. These do not exist so we will be creating new Test Steps. Click Step button in Toolbar to open the New Test Step window. Enter a name to describe the Step and then click to open Keyword selection. We have not created Keywords yet so we will be using a placeholder keyword, AA_TBD. After we created Keywords, we will return and update these Test Steps. Click the "Add" button (hidden under Keyword selection box) when done



10. The new Step appears as shown below



11. Repeat the above (9) to add the remaining Steps. When done, your display should look like the below image. For the last step, we will add a Verification Step. To do so, click "Verify Calculation" step [1] then click Verification Step button in toolbar [2]


12. The New Verification Step window is displayed. Enter the information as shown and then click the Add button. Expected value is the expected answer of our step, 5 which is the result of 2 + 3. We are going to read this value in "Verify calculation" Step which is after step "Click =". So Actual Step selection should be "Verify calculation"


13. After adding the Verification Step, it appears under the Test Step to which it belongs as shown below


14. Now that we have created our Test Case, and we are satisfied that it is accurate or fairly accurate, we can hook it up to Google Calculator website. The next section of creating Control Elements is where the binding happens. In order to do so, we need to obtain the ID of the controls that we would invoke on the application if we were do the action manually. In our case that would be the ID for the "2 button", "+ button", "3 button", "= button" and "result" area.

The ID is identified by XPATH and to find the XPATH of an element, we can use Chrome Browser's"Developer Tools".
Press F12 to open "Developer Tools" (Press F12 again to hide it). Or from the menu, More Tools...Developer Tools.
Check that "Elements" is selected. Click the icon [1]. Now you can click on any area of your website and the corresponding HTML will display in the Elements pane. If you clicked the wrong area, you will need to click [1] again as it is only good for one click.
After you click [1], move your mouse to button 2. As you move a box appears to highlight the control that corresponds to the HTML code showing in Elements pane. Make sure your mouse pointer is right on top of 2 before you click. The selection in Elements pane now displays the HTML for the control we are interested in, the 2 button.


15. To get the XPATH, right click on the HTML code in Elements pane, select Copy, then Copy XPATH. Now that we have our XPATH, we can create a Control Element


16. Back in EAF Tester, click Control Element [1] which opens New Control Element window. Enter a name, paste the XPATH copied from previous step and for Control Type select html_span. If you do not know what Control Type to select, do not worry as it is not important. Click Add button to create the Control Element.


17. The new Control Element is added and appears under Control Elements for selected System / Version


18. Repeat the above steps to create Control Elements for "+", "3", "="


19. For "Result" Control Element, we get the XPATH by clicking on the answer area as shown below


20. After creating the Control Element for Result, we are now ready to create Keywords. Below you can see the Control Element for Result as well as all the rest


21. To create Keywords, click the Keyword button [1] in toolbar. This opens a New Keyword window. Enter a "Name" [2], select "Method" [3] which is "clickLink" for Google Calculator buttons, select corresponding Control Element for Keyword [4] and lastly click the Add button [5] to create the Keyword


22. The Keyword is added and appears under Keywords section as shown below


23. Repeat the above to add all Keywords. Make sure you match the correct Control Element to your Keyword. For the "Get Result" Keyword, select Method getText as we want to read the calculated answer. Your window should now look like the below image


24. Now that we have created all Keywords, we can go back and update Test Steps to replace the placeholder we used for Keyword with the real one. Select the Step to update, then select the corresponding Keyword and finally click the Update button to save the change. In the image below, the Update button is hidden under the Keyword Selection box.


25. The image below shows the Step was updated successfully


26. Update all the 5 Steps with actual Keywords. Only the new Steps that we created need to be updated. The initial 3 that we added do not need to be changed.


27. We can now create a Test Plan. A Test Plan is what is executed. It contains 1 or more Test Cases in desired order. Our Test Plan will contain 2 Test Cases. The first is an existing Test Case to launch a browser and the second will be the one we just created. First create a Test Plan by clicking on Test Plan button [1]. A New Test Plan window opens. Enter a "Name'' [2] and "Description" [3] then click the Add button [4] to create it.


28. The Test Plan is created as shown below


29. Now we can add Test Cases to the Test Plan. Select the Test Plan, then click "Case" button [1] in toolbar. In the "New Test Case" window, click "Select from existing" radio button and select the Test Case to launch your browser. We have selected Chrome but if you do not have Chrome or have another browser installed, select it instead. When done, click the Add button [4]


30. Repeat the above to add "Google Calculator Test" Test Case to the Test Plan. The order of Test Cases is important as we want the browser to launch first before the Calculator can be tested.


31. With the Test Plan complete, we can now generate it. Select the Test Plan [1] then click the Generate [2] button. Depending on your computer, database etc., it should take less than a second to several before you see [3] success message.


32. Before we can run the Test Plan, we need to make one more change. Recall that we used existing Test Steps. The Step that provides the search text currently points to "google news". We need to change it to search for "calculator". To make that change, expand the Test Plan, then expand Test Case for Google Calculator, then expand the Test Step "Enter Search Text". Under Step Data, click on the first and only entry. In the "Edit Test Data" window, change "google news" to "calculator" and click the Update button to save your change.


33. After clicking the Update button, you should see an "Item updated successfully" message [3] as well as updated Step Data on the tree showing "calculator" [3]


34. We are ready to run our Test. From the main window, click Run...Execute


35. In the Execute Tests window, expand the tree to select "Google Calculator" Test Plan. Then click File...Execute. In a second or two, you should see your browser launch and the test should execute. After it completes, the browser should close automatically.


36. After the test completes, you need to refresh the window to show the Executions. To refresh, select another item and then re-select Google Calculator Test Plan. A list of all Executions is displayed. In the example below, the Test was executed 6 times. Click a Run to view details. In the "View Test Run Outcome" window, click the "View" button to bring up a report of the Test.


37. The test report below shows all the executions as well as screenshots taken during the test. To view a bigger version of the image, click on it.


38. You can drill down a Run to view details of the individual steps. In case a test was unsuccessful, you can zero in on the Step that failed.