Software Testing Social Network

Free Software Testing Tutorial and Quality Assurance Portal

Home Featured Articles Testing Tools Borland Segue SilkCentral Test Manager Borland SilkTest - Extending the Test

Borland SilkTest - Extending the Test

Article Index
Borland SilkTest - Extending the Test
Page 2
All Pages

This section will show how to take the “VerifyLogin” test and customize it so that the steps it contains can be applied to more than a single user account’s username and password information. Once we have gone through the instructions in this section, SilkTest will have produced for us a version of the
“VerifyLogin” test that is commonly referred to in automated testing jargon as a “data driven” test, meaning one test can be driven, or executed, against many different data sets to increase test coverage without having to create and maintain a separate test for each different instance of data.

For this section, the steps to be performed will all be accomplished by interacting with the Data Driven workflow element of the SilkTest user interface, as shown below.

 

Before we get into the instructions for this section, please make sure you have opened the file SilkTestEvalGuideData.xls which is in the “Demonstration” folder under the SilkTest installation directory. This file contains user account information that will be used in this section. The picture below shows a portion of the files contents; note that there are two columns (Username and
Password) and three data rows.

 

Step 1 Make sure the script1.t file is open and is the top window shown in the SilkTest user interface
Step 2 Click the “Data Drive Testcase” button on the Data Driven workflow bar
Step 3 Ensure that the “VerifyLogin” item is highlighted in the “Testcase” list of the “Select Testcase” dialog and click the “OK” button
Step 4 Ensure that the “Create a new file/Overwrite an existing file” radio button on the “Specify Data Driven Script” dialog is selected and then click the “OK” button on this dialog
Step 5 On the “Select Data Source” dialog, click the “Browse” button and, using the “Select workbook” dialog, navigate to the SilkTestEvalGuideData.xls file, eventually double-clicking that file name or clicking “Open” on the “Select workbook” dialog
Step 6 Click the “OK” button on the “Select Data Source” dialog
Step 7 Ensure that the “Add a new Data Driven testcase” radio button on the “Specify Data Driven Testcase” dialog is selected and click the “OK” button on this dialog
Step 8 On the “Find/Replace Values” dialog, uncheck the “Number” and “True/False” checkboxes in the “Find values of type” area so that only the “Text” checkbox is checked

Step 9 Click the “Find Next” button on the “Find/Replace Values” dialog
At this point, the first occurrence of the text “dotnet” in the VerifyLogin test should be highlighted as pictured below.

 

 Step 10 In the drop down list labeled “Column” on the “Find/Replace Values” dialog, choose the “Username” item
Step 11 Click the “Replace” button on the “Find/Replace Values” dialog
Step 12 Click the “Find Next” button again on the “Find/Replace Values” dialog At this point, the second occurrence of the text “dotnet” in the VerifyLogin test should be highlighted.
Step 13 In the drop down list labeled “Column” on the “Find/Replace Values” dialog, choose the “Password” item
Step 14 Click the “Replace” button on the “Find/Replace Values” dialog
Step 15 Click the “Cancel” button on the “Find/Replace Values” dialog

We have now finished creating, via interaction with the Data Driven workflow bar, a data driven version of VerifyLogin; this version is called DD_VerifyLogin. In SilkTest, the script file script1.g.t should be opened and be the top window in the right hand side of the SilkTest interface. The picture below shows a portion of the contents of the DD_VerifyLogin test; notice that the references to the text “dotnet” that are in the VerifyLogin test have been replaced as a result of the steps we just completed above.

 

Now, we will execute the DD_VerifyLogin test.
Step 16 Click the “Run Testcase” button on the Data Driven workflow bar
Step 17 Ensure that the “DD_VerifyLogin” item is highlighted in the “Testcase” list of the “Run Testcase” dialog and click the “Run” button
SilkTest will now do the following:

  •  Execute the recovery system and the associated steps we configured for it; this means SilkTest will ensure that Internet Explorer is running and the Pet Shop home page address is loaded.Since the test DD_VerifyLogin is data driven, SilkTest will actually execute the entire test onceper row of data found in the SilkTestEvalGuidData.xls workbook; in other words, three total executions. Additionally, in order to ensure that each individual test execution gains the initial startup steps we configured, the recovery system steps will occur three times as well
  •  Execute the actual contents of our DD_VerifyLogin test, going through each statement in the test and carrying out the actions described in the test and finishing with the property verifications we specified
  •  Bring to the foreground in the right hand side of the SilkTest user interface a window containing the file script1.g.res which has test execution status of the test we just executed including Pass/Fail and other information. Notice that the file indicates that three tests were executed,and that three tests passed. You can also see on separate lines three different indications of the account information used in each individual execution of the test.

That’s it – we’ve now gone through the method of using the SilkTest Data Driven workflow to take our original test, VerifyLogin, and create a modified version, DD_VerifyLogin, that is data driven and can be used to verify multiple sets of account information rather than just the single account information
that VerifyLogin tests.

Before moving to the next section, let’s take a further look at the DD_VerifyLogin test. As stated earlier, DD_VerifyLogin, when compared to the test VerifyLogin, has the advantage of being able to be used to test different account data. However, both tests have a disadvantage in common. In particular, each test describes very specific steps for interacting with the Pet Shop user interface and is therefore very dependent on how the Pet Shop user interface was designed at the time we recorded VerifyTest. This dependency on the specific design and behavior of the user interface can leave our tests extremely prone to execution failure if the user interface undergoes changes in design and/or behavior. The next section will discuss one specific customization that can be made to the DD_VerifyLogin test so that it can be better insulated from future Pet Shop user interface changes.



  Attention! For US visitors deep discounted electronics products available! CLICK HERE to check it out.