Вы находитесь на странице: 1из 23
SilkTest Tutorials  Sanjay Kumar Page 1
SilkTest Tutorials  Sanjay Kumar Page 1
SilkTest Tutorials  Sanjay Kumar Page 1
SilkTest Tutorials  Sanjay Kumar Page 1

SILK TEST

SILK TEST INTRODUCTION Silk Test is a tool specifically designed for doing REGRESSION AND FUNCTIONALITY testing.

INTRODUCTION

Silk Test is a tool specifically designed for doing REGRESSION AND FUNCTIONALITY testing. It is developed by Segue Software Inc. Silk Test is the industry‟s leading functional testing product for e-business applications, whether Window based, Web, Java, or traditional client/server-based. Silk Test also offers test planning, management, direct database access and validation, the flexible and robust 4Test scripting language, a built in recovery system for unattended testing, and the ability to test across multiple platforms, browsers and technologies.

You have two ways to create automated tests using silktest:

1. Use the Record Testcase command to record actions and verification steps as you navigate through the application.

2. Write the testcase manually using the Visual 4Test scripting language.

1. Record Testcase

The Record / Testcase command is used to record actions and verification steps as you navigate through the application. Tests are recorded in an object-oriented language called Visual 4Test. The recorded testreads like a logical trace of all of the steps that were completed by the user. The Silk Test point and click verification system allows you to record the verification step by selecting from a list of properties that are appropriate for the type of object being tested. For example, you can verify the text is stored in a text field.

2. Write the Testcase manually We can write tests that are capable of accomplishing many variations on a test. The

A test case can be designed to take parameters including input data and

expected results. This “data-driven” testcase is really an instance of a class of test cases that performs certain steps to drive and verify the application-under-test. Each instance varies by

the data that it

key here is re-use.

Since far fewer tests are written with this approach, changes in the

GUI will result in reduced effort in updating tests. A data-driven test design also allows for

carries.

in updating tests. A data-driven test design also allows for carries. SilkTest Tutorials  Sanjay Kumar
in updating tests. A data-driven test design also allows for carries. SilkTest Tutorials  Sanjay Kumar

SILK TEST

SILK TEST the externalization of testcase data and makes it possible to divide the responsibilities for

the externalization of testcase data and makes it possible to divide the responsibilities for developing testing requirements and for developing test automation. For example, it may be that a group of domain experts create the Testplan Detail while another group of test engineers develop tests to satisfy those requirements.

In a script file, an automated testcase ideally addresses one test requirement. Specifically, a 4Test function that begins with the test case keyword and contains a sequence of 4Test statements. It drives an application to the state to be tested, verifies that the application works as expected, and returns the application to its base state.

A script file is a file that contains one or more related testcases. extension, such as find .t

Other Segue products The Silk products include

A script file has a .t

Sit Test for functional and regression testing Silk Performer for load and performance simulation Silk Pilot for functional and regression testing CORBA and EJB servers Silk Radar for automated defet tracking Silk Vision for enterprise application health monitoring Silk Express for a scalability and load testing consulting solution.

Silk Test Features :

Some of the feature of silk test are given below.

Easy to use interfaceFeatures : Some of the feature of silk test are given below. Built in recovery system

Built in recovery systemfeature of silk test are given below. Easy to use interface The object oriented concept Record

The object oriented conceptgiven below. Easy to use interface Built in recovery system Record & Play Multi-kind application testing

Record & PlayBuilt in recovery system The object oriented concept Multi-kind application testing SilkTest Tutorials 

Multi-kind application testingBuilt in recovery system The object oriented concept Record & Play SilkTest Tutorials  Sanjay Kumar

object oriented concept Record & Play Multi-kind application testing SilkTest Tutorials  Sanjay Kumar Page 3
object oriented concept Record & Play Multi-kind application testing SilkTest Tutorials  Sanjay Kumar Page 3

SILK TEST

SILK TEST Automatic generation of results Browser & Platform independent 24 x 365 unattended testing Distributed

Automatic generation of resultsSILK TEST Browser & Platform independent 24 x 365 unattended testing Distributed Access to Test Results

Browser & Platform independentSILK TEST Automatic generation of results 24 x 365 unattended testing Distributed Access to Test Results

24 x 365 unattended testinggeneration of results Browser & Platform independent Distributed Access to Test Results Cross – Platform Java

Distributed Access to Test Results& Platform independent 24 x 365 unattended testing Cross – Platform Java Testing Testing Across Multiple

Cross – Platform Java Testing Platform Java Testing

Testing Across Multiple Browsers and Windows VersionsAccess to Test Results Cross – Platform Java Testing Support for HTML, XML, JavaScript, Java, Active

Support for HTML, XML, JavaScript, Java, Active X, Windows controls, and Visual Basic.Testing Across Multiple Browsers and Windows Versions Single-recording testing for cross-platform Java testing

Single-recording testing for cross-platform Java testing with the Silk Bean.Java, Active X, Windows controls, and Visual Basic. Against Over 35 Databases. Link Tester Validation of

Against Over 35 Databases.testing for cross-platform Java testing with the Silk Bean. Link Tester Validation of Advanced Database Structure

Link TesterJava testing with the Silk Bean. Against Over 35 Databases. Validation of Advanced Database Structure and

Validation of Advanced Database Structure and Techniqueswith the Silk Bean. Against Over 35 Databases. Link Tester Creation of Test Plan Test Frame

Creation of Test Plan Test Frame Test SuiteValidation of Advanced Database Structure and Techniques Integration with other silk products. Silk Test Architecture

Integration with other silk products.and Techniques Creation of Test Plan Test Frame Test Suite Silk Test Architecture Normal use of

Silk Test Architecture

Normal use of an application consists of a person manipulating a keyboard and mouse to initiate application operations. The person is said to be interacting with the GUI (Graphical User Interface). During Silk Test testing, Silk Test interacts with the GUI to submit operations to the application automatically.

Thus Silk Test can simulate the actions of a person who is exercising all the capabilities of an application and verifying the results of each operation. The simulated user (Silk test) is said to be driving the application. The application under test reacts to the simulated user exactly as it would react to a human rest. Silk Test consists of two distinct software components that execute in separate processes :

The Silk Test host software The 4Test Agent software

separate processes : The Silk Test host software The 4Test Agent software SilkTest Tutorials  Sanjay
separate processes : The Silk Test host software The 4Test Agent software SilkTest Tutorials  Sanjay

SILK TEST

SILK TEST Silk Test host software The Silk Test host software is the program you use

Silk Test host software

The Silk Test host software is the program you use to develop, edit, compile, run and debug your 4Test scripts and test plans. This manual refers to the system that runs this program as the host machine or the Silk Test machine.

The Agent

The 4Test Agent is the software process that translates the commands in your 4Test scripts into GUI-specific commands. In order words, it is the Agent that actually drives and monitors the application you are testing. One Agent can run locally on the host machine. In a networked environment, any number of Agents can run on remote machines. This manual refers to the systems that run remote Agents as target machines. This manual refers to the systems that run remote Agents as target machines. In a client/server environment, Silk Test drives the client application by means of an Agent process running on each application‟s machine. The application then drives the server just as it always does. Silk Test is also capable of driving the GUI belonging to a server or of directly driving a server database by running scripts that submit SQL statements to the database. These methods o directly manipulating the server application are intended to support testing in which the client application drives the server.

Limitations of Silk Test:

Some of the limitations of Silk Test are given below:

SilkTest may not recognize some objects in a window / page due to some technical reasons.Test: Some of the limitations of Silk Test are given below: Silk Test may not recognize

Silk Test may not recognize some window frames.objects in a window / page due to some technical reasons. The „tag‟ value may get

The „tag‟ value may get changed frequently.reasons. Silk Test may not recognize some window frames. Sometimes it will be difficult to activate

Sometimes it will be difficult to activate some window.frames. The „tag‟ value may get changed frequently. It may be necessary to make some modifications

It may be necessary to make some modifications if testing should be shifted to other browser / operating system.changed frequently. Sometimes it will be difficult to activate some window. SilkTest Tutorials  Sanjay Kumar

if testing should be shifted to other browser / operating system. SilkTest Tutorials  Sanjay Kumar
if testing should be shifted to other browser / operating system. SilkTest Tutorials  Sanjay Kumar

SILK TEST

SILK TEST In web based applications, sometimes, silktest will take the links as simple text. System

In web based applications, sometimes, silktest will take the links as simple text.SILK TEST System Requirements : The minimum requirement, a system needs to run the silk test

System Requirements :

The minimum requirement, a system needs to run the silk test is given below :

Windows NT, Windows 95, 98 or 2000 Pentium 466 Mhz or better processor (application dependent) 32 MB RAM 60MB Hard Disk

Supported Environments :

Netscape Navigator 4.x Internet Explorer 4 and 5 Active X, Visual Basic 5 and 6 Java JDK 1.3 Swing 1.1 Microsoft Web browser control

THE AUTOMATED TESTING PROCESS The testing process has these for steps :

Creating a testplan (if you are using the testplan editor)TESTING PROCESS The testing process has these for steps : Recording a test frame. Creating testcases

Recording a test frame.: Creating a testplan (if you are using the testplan editor) Creating testcases Running testcases and

Creating testcasesyou are using the testplan editor) Recording a test frame. Running testcases and interpreting their results.

Running testcases and interpreting their results.testplan editor) Recording a test frame. Creating testcases Creating a testplan If the testplan editor is

Creating a testplan

If the testplan editor is used, the automated testing process is started by creating a testplan. A basic testplan is structured as a hierarchical outline and contains:

A basic testplan is structured as a hierarchical outline and contains: SilkTest Tutorials  Sanjay Kumar
A basic testplan is structured as a hierarchical outline and contains: SilkTest Tutorials  Sanjay Kumar

SILK TEST

SILK TEST Descriptions of individual tests and groups of tests. As many levels of description can

Descriptions of individual tests and groups of tests. As many levels of description can be used.SILK TEST Statements that link the test descriptions in the plan to the 4Test routines, called

Statements that link the test descriptions in the plan to the 4Test routines, called testcases, that accomplish the actual work of testing.groups of tests. As many levels of description can be used. Recording a test frame Next,

Recording a test frame

Next, record a test frame, which contains descriptions, called window declarations, of each of the GUI objects in your application. A window declaration specifies a logical, cross- platform name for a GUI object, called the identifier, and maps the identifier to the object‟s actual name, called the tag. In addition, the declaration indicates the type of the object, called its class.

Creating testcases

The 4Test commands in a testcase collectively perform three distinct actions :

Drive the application to the state to be tested.in a testcase collectively perform three distinct actions : Verify the state (this is the heart

Verify the state (this is the heart of the testcase).actions : Drive the application to the state to be tested. Return the application to its

Return the application to its original state.Verify the state (this is the heart of the testcase). The powerful object-oriented recorder can be

The powerful object-oriented recorder can be used to automatically capture these 4Test commands to interact with the application, or to white the 4Test code manually if one is comfortable with programming languages. For maximum ease and power, these two approaches can be combined, recording the basic testcase and then extending it using 4Test‟s flow of control features.

Running testcases and interpreting results

Next, run one or more testcases, either by running a collection of scripts, called a suite, or, if you are using the testplan editor, by running specific portions of the testplan. As each testcase runs, statistics are written to a results file. The results file and its associated comparison tools allow you to quickly pinpoint the problems in your application.

tools allow you to quickly pinpoint the problems in your application. SilkTest Tutorials  Sanjay Kumar
tools allow you to quickly pinpoint the problems in your application. SilkTest Tutorials  Sanjay Kumar

SILK TEST

SILK TEST A Test Frame The test frame is the backbone that supports the testcases and

A Test Frame

The test frame is the backbone that supports the testcases and scripts. It is a file that contains all the information about the application‟s GUI objects that Silk Test needs when you record testcases. This information minimally consists of a declaration for each GUI object, but can also include any data that you want to associate with each GUI object, as well as any new classes and methods that you want to define.

A window declaration specifies a cross-platform, logical name for a GUI object, called the identifier, and maps the identifier to the object‟s actual name, called the tag. Because the testcases use logical names, if the object‟s actual name changes on the current GUI, on another GUI, or in a localized version of the application, only the tag in the window declarations need to be changed; don‟t need to change any of the scripts. Variables, functions, methods, properties can be added to the basic window declarations recorded by Silk Test.

To record declarations for the main window and menu hierarchy of your application.

1. Start up your application and Silktest.

2. Select File / New. The New dialog appears.

3. Select the Test Frame radio button and click OK. The New Test Frame dialog is displayed, allowing to create a test.

4. Frame file for an application displayed in the Application list box.

5. Select the application fro the Application list box. If a Web application is tested, different fields are seen.

6. Click OK. The new test frame file is created. The file contains the 4Test declarations for the main window and all its menus, as well as a generic declaration that is valid for each of the standard message boxes in the application.

that is valid for each of the standard message boxes in the application. SilkTest Tutorials 
that is valid for each of the standard message boxes in the application. SilkTest Tutorials 

SILK TEST

SILK TEST A Test Plan a large amount of information, a structured, hierarchical outline provides an

A Test Plan

a large amount of information, a structured, hierarchical

outline provides an ideal model for organizing and developing the details of the plan. A

testplan consists of two distinct parts

A Testplan is made up of

An outline that describes the test requirementsconsists of two distinct parts A Testplan is made up of Statement that connect the outline

Statement that connect the outline to the 4Test scripts and testcases that implement the test requirements.made up of An outline that describes the test requirements Using the testplan, we can create

Using the testplan, we can create and run tests.

To start a new testplan :

Select File / Newwe can create and run tests. To start a new testplan : Select Testplan and click

Select Testplan and click OK.and run tests. To start a new testplan : Select File / New An empty testplan

An empty testplan window opens.

A Test Suite

A Test Suite is a collection of test scripts. Consider a case that we are having a set of

script (.t) file. If we want to run these scripts against our application, we have to select the required testcase or we have to run the entire script file. But after the completion of that script file, the user has to manually change that to the next script file to run those testcases available in that script. Instead of that silktest provides a way to continuously select a set of script files and run those script files at-a-stretch. This can be done by creating a new Test

Suite file and declare the needed script files in that suite file.

To start a new test suite:

1. Select File / New.

2. Select Test Suite and click OK.

a new test suite: 1. Select File / New. 2. Select Test Suite and click OK.
a new test suite: 1. Select File / New. 2. Select Test Suite and click OK.

SILK TEST

SILK TEST 3. In that suite file enter the script file names to run continuously. 4.

3.

In

that suite file enter the script file names to run continuously.

4.

Save that script file.

5.

Compile the script file and run it.

6.

Now the process of running the script will not stop after the completion of the first script file, instead of that it will automatically pass to the next script file and run the testcases available there.

Assume a case where there is a folder called silk scripts in c drive with five test script files. Here in the suite file, we are calling all the script files instead of running those script files separately. The suite file will look like as given below :

// Clicknnglinks.t

use c:\silkscripts.\script.t” use “c:\silkscripts.\script2t” use “c:\silkscripts./script3.t”

use”c:\silkscripts\script4.t”

use”c:\silkscripts\5.”

A Test script

A testscript file contains various testcases for various test conditions.

A Testcase

In a script file, a testcase ideally addresses one test requirement. Specifically, a 4Test function that begins with the testcase keyword and contains a sequence of 4Test statements. It drives an application to the state to be tested, verifies that the application works as expected, and returns the application to its base state.

In the silktest tool, select the File -> Now option the menu bar.as expected, and returns the application to its base state. In the resulting dialog box „New‟,

In the resulting dialog box „New‟, there will be options for selecting different kind of files. different kind of files.

Select the file type 4‟ test script‟ option.will be options for selecting different kind of files. It will open a new script file.

It will open a new script file.different kind of files. Select the file type 4‟ test script‟ option. SilkTest Tutorials  Sanjay

the file type 4‟ test script‟ option. It will open a new script file. SilkTest Tutorials
the file type 4‟ test script‟ option. It will open a new script file. SilkTest Tutorials

SILK TEST

SILK TEST Before start writing the testcase, declare the necessary file that is to be used
Before start writing the testcase, declare the necessary file that is to be used

Before start writing the testcase, declare the necessary file that is to be used

in

that script file.

Start with the keyword „testcase‟ followed by the testcase name. The name of the testcase

Start with the keyword „testcase‟ followed by the testcase name. The name of the testcase is whatever as selected by the user. But make sure that by looking at the name of the testcase, the objective of the testcase should be understandable.

Start the tests from the scratch so that the silktest will start eh application and

Start the tests from the scratch so that the silktest will start eh application and to the testing from the base state.

Use necessary conditions / loops if necessary.

Use necessary conditions / loops if necessary.

At the end of each and every script, print a statement to know whether the

At the end of each and every script, print a statement to know whether the test case has achieved its objective or not. The user can make sure that the particular part of the application is error free by looking at the message you print.

Try to make the testcase effective and time consuming (say) by keeping the second tests

Try to make the testcase effective and time consuming (say) by keeping the second tests continue from the place where the first test finishes.

A sample testcase for registering into the yahoo mail.

A

sample testcase for registering into the yahoo mail.

Testcase registration ()

Browser.LoadPage “mail.yoo.com”)registering into the yahoo mail. Testcase registration () Sign In YahooMail.SetActive () SignIn Yahoo.Mail.objSingIn

Sign In YahooMail.SetActive ()registration () Browser.LoadPage “mail.yoo.com”) SignIn Yahoo.Mail.objSingIn YahooMail.SignUp.Now.Click()

SignIn Yahoo.Mail.objSingIn YahooMail.SignUp.Now.Click()“mail.yoo.com”) Sign In YahooMail.SetActive () Sleep (3) WelcomeTo Yahoo.Set Active Welcome To

Sleep (3)() SignIn Yahoo.Mail.objSingIn YahooMail.SignUp.Now.Click() WelcomeTo Yahoo.Set Active Welcome To

WelcomeTo Yahoo.Set ActiveYahoo.Mail.objSingIn YahooMail.SignUp.Now.Click() Sleep (3) Welcome To

Welcome To yahoo.objWelcomeToYahoo.LastName.SetText(“lastname”)Sleep (3) WelcomeTo Yahoo.Set Active Welcome To Yahoo.objWelcomeToYahoo.LanguageConten1.Select(5)

Welcome To Yahoo.objWelcomeToYahoo.LanguageConten1.Select(5)To yahoo.objWelcomeToYahoo.LastName.SetText(“lastname”) WelcomeTo Yahoo.objWelcome ToYahoo.ContactMeOccassionally

WelcomeTo Yahoo.objWelcome ToYahoo.ContactMeOccassionally About.Click ()Welcome To Yahoo.objWelcomeToYahoo.LanguageConten1.Select(5) Welcome To Yahoo.objWelcome To Yahoo.Submit ThisForm.Click()

Welcome To Yahoo.objWelcome To Yahoo.Submit ThisForm.Click()ToYahoo.ContactMeOccassionally About.Click () If Registration Success.Exists () Print (“Test Pass”)

If Registration Success.Exists ()Welcome To Yahoo.objWelcome To Yahoo.Submit ThisForm.Click() Print (“Test Pass”) else logerror (“Test Fail”)

Print (“Test Pass”)ThisForm.Click() If Registration Success.Exists () else logerror (“Test Fail”) SilkTest Tutorials 

elseIf Registration Success.Exists () Print (“Test Pass”) logerror (“Test Fail”) SilkTest Tutorials  Sanjay

logerror (“Test Fail”)If Registration Success.Exists () Print (“Test Pass”) else SilkTest Tutorials  Sanjay Kumar Page 11

Success.Exists () Print (“Test Pass”) else logerror (“Test Fail”) SilkTest Tutorials  Sanjay Kumar Page 11
Success.Exists () Print (“Test Pass”) else logerror (“Test Fail”) SilkTest Tutorials  Sanjay Kumar Page 11

SILK TEST

SILK TEST Silk Test installation tips Run the Silk Test setup from the CD or through

Silk Test installation tips

Run the Silk Test setup from the CD or through the Network.SILK TEST Silk Test installation tips the Firesip\Europa\softare\siltest5.0.1\ siltest‟ directory in your Network

the

Firesip\Europa\softare\siltest5.0.1\siltest‟ directory in your Network Neighborhood.

Get into the above folder and select the setup.exe file to start the installation.siltest‟ directory in your Network Neighborhood. During installation, it will ask for the licence file. Set

During installation, it will ask for the licence file. Set the path “Firesip \Europa\software\siltest 5.0.1\ licence‟ for the “licence.dat” file. “Firesip\Europa\software\siltest 5.0.1\licence‟ for the “licence.dat” file.

In the installation process, it will ask for the Silk/test/Silk Test Agent only option. Select the Silk Test option if you are installing this for testing applications in the stand-alone machine.5.0.1\ licence‟ for the “licence.dat” file. For the „Will you be testing browsers?‟ message box,

For the „Will you be testing browsers?‟ message box, select “Yes” if you are going to test web based applications. going to test web based applications.

The Silk Test“Yes” if you are going to test web based applications. Software is available in It will

Software

is

available

in

It will ask for the default browser option. Select the appropriate Browser you want to test the application using Silk Test. Note that you are allowed to select only one Browser option. By default Silk Test goes fine with Netscape browsers.based applications. The Silk Test Software is available in After installing, it will open the Silk

After installing, it will open the Silk Test tool with the Quick start wizard open. The quickstart wizard will assist you in creating various silk files. If you are a first time user of silktest, the continue with that.By default Silk Test goes fine with Netscape browsers. Getting started with the Quickstart Wizard you

Getting started with the Quickstart Wizard

you are using Silk Test with the testplan editor, you can use the QuickStart Wizard, which greatly simplifies the four steps of automated testing.

hen you start Silk Test the first time (or whenever you start and have no open windows), the QuickStart Wizard is displayed automatically. You can also invoke the wizard at any time by selecting File/New and clicking the Quickstart Wizard icon.

at any time by selecting File/New and clicking the Quickstart Wizard icon. SilkTest Tutorials  Sanjay
at any time by selecting File/New and clicking the Quickstart Wizard icon. SilkTest Tutorials  Sanjay

SILK TEST

SILK TEST You can use the Quickstart wizard to : 1. Create a testplan You simply

You can use the Quickstart wizard to :

1. Create a testplan You simply name the file (giving it the .pln extension) and its directory.

2. Create a test frame,

Which contains descriptions of the GUI objects in your application that you want to test. As prompted, you simply open your application and open the various windows and dialogs that you want to test in the application. The wizard automatically records all the declarations in a file called frame.inc. You don‟t have to do any coding.

3. Record testcases

You name the testcase and provide a description for the testplan, then simply record the testcase. Again, you don‟t have to do any coding. The wizard automatically sages the

testcase in script (.t) file with the same name as the testplan.

Run testcases.

Procedure To use the wizard :

1. Involve the wizard by selecting File /New and clicking the QuickStart Wizard icon. Now you will name a new testplan, which will organize and manage your tests.

2. Click Next.

3. Name the file edit.pln and Next. The next step is to record the test frame, which defines all the windows, dialogs, menus, and so on that you want to test.

4. To create a new test frame, leave New Test Frame selected and click Next. At this point, the wizard lists all the open (running and not minimized) applications. If Text Editor is not open, you can open it now (it is the directory where you installed Silk Test). After you open the Text Editor, click on the QuickStart Wizard title bar to see Text Editor added to the list of applications.

5. Select Text Editor and click next.

6. The capture Windows panel displays, describing the procedure.

next. 6. The capture Windows panel displays, describing the procedure. SilkTest Tutorials  Sanjay Kumar Page
next. 6. The capture Windows panel displays, describing the procedure. SilkTest Tutorials  Sanjay Kumar Page

SILK TEST

SILK TEST 7. Click Next. 8. Now you simply open a document window an open all

7. Click Next.

8. Now you simply open a document window an open all the dialogs hat you want to test in the Text Editor. When you place the mouse pointer on a window or dialog, the wizard records all the declarations that SilkTest needs in a file called frame.inc in the same directory as your testplan.

9. When you have finished capturing the windows and dialogs in Text Editor, click Return to Wizard in the Capturing New Windows dialog. Now that you have created you test frame, you are ready to create a testcase.

10. Click Next twice.

11. Name the test Find Box and enter the description “Verify controls in Find dialog.” Click Next. You test is now being recorded, as indicated by the Record Status window on your screen.

12. Now go to Text Editor, select Search / Find to open the Find dialog, place your mouse pointer over the dialog‟s title bar, and press Ctrl + Alt to verify its state. The verify windows dialog displays. Click OK to verify all properties for the dialog. Close the Find dialog (to return to your base state), then click Done in the Record Status window. You return to the Wizard and are asked to confirm that the test is what you want.

13. Click Next.

14. Run the test by clicking the Run Test Button.

15. The wizard reports the results. You an move the wizard to the side and look at the results file that is created whenever you run a test.

16. In the wizard, click Next to save your testcase. The testcase is saved in a script (.t) file with the same name as testplan (in this case, edit.t)

17. Click Close to close the wizard. You see a window containing the results file from the test you just ran. In another window is the testplan.

Configuring the settings

In Silk Test, select Option -> Extentions menu from the menu bar.In another window is the testplan. Configuring the settings It will load the Extentions dialog box.

It will load the Extentions dialog box.select Option -> Extentions menu from the menu bar. In that dialog box, check the kind

In that dialog box, check the kind of application you re testing.from the menu bar. It will load the Extentions dialog box. Say, if you are testing

Say, if you are testing the web based application in the Netscape browser, Enable the Netscape option by checking against it and un-check all the other options.box. In that dialog box, check the kind of application you re testing. SilkTest Tutorials 

Netscape option by checking against it and un-check all the other options. SilkTest Tutorials  Sanjay
Netscape option by checking against it and un-check all the other options. SilkTest Tutorials  Sanjay

SILK TEST

SILK TEST Click on the OK button. Now click on the Options - > Runtime option.

Click on the OK button.SILK TEST Now click on the Options - > Runtime option. Set the „use path‟ option

Now click on the Options - > Runtime option.SILK TEST Click on the OK button. Set the „use path‟ option to point to the

Set the „use path‟ option to point to the silktest installed folder. Say if the silktest has been installed in you c:\ drive then set the sue files = “C: \Program Files\Segue\SilkTest\ been installed in you c:\ drive then set the sue files = “C:\Program Files\Segue\SilkTest\ETEND”. This is to use the common include files as per the application.

Since we have selected the Extensions, the use file will have the declaration „extend‟ \ netscape.inc‟ of the includ e file. Now the script is ready to open „extend‟\netscape.inc‟ of the include file. Now the script is ready to open the Netscape browser by default and run the scripts.

From the status bar Go to the Start - > Programs -> Silk Test -> Extention Enabller option, to declare the same set of extensions (as in step 4) in the „Extention option, to declare the same set of extensions (as in step 4) in the „Extention Enabler‟ dialog box.

Exposure to Silk Test IDE

To Start the Silk Test tool Select the „Start‟ button in Windows status bar. Go to Program -> Silk Test -> Silk Test‟ option (with green color icon) It will open the silktest tool. If you get the Quickstart wizard, close the wizard if you don‟t need it or else, refer to the „Installation tips‟ to go with the wizard.

refer to the „Installation tips‟ to go with the wizard. To compile & run scripts Open
refer to the „Installation tips‟ to go with the wizard. To compile & run scripts Open
refer to the „Installation tips‟ to go with the wizard. To compile & run scripts Open
refer to the „Installation tips‟ to go with the wizard. To compile & run scripts Open

To compile & run scripts Open the testsscript file (with the extension .t). Select the Run - > Compile option from the menu bar. Also we can select the icon with the „tick‟ mark to compile the scripts. The files that are associated with the script files will also get compiled. Hence if there is any problem with the include file, you will get error by compiling the testscript file itself.

include file, you will get error by compiling the testscript file itself. SilkTest Tutorials  Sanjay
include file, you will get error by compiling the testscript file itself. SilkTest Tutorials  Sanjay
include file, you will get error by compiling the testscript file itself. SilkTest Tutorials  Sanjay
include file, you will get error by compiling the testscript file itself. SilkTest Tutorials  Sanjay
include file, you will get error by compiling the testscript file itself. SilkTest Tutorials  Sanjay

SILK TEST

SILK TEST To compile a selected file, keep the mouse cursor on that particular file and

To compile a selected file, keep the mouse cursor on that particular file and give the Run-Compile option.SILK TEST The „Run option will get enabled only for the testscript files. We cannot run

The „Run option will get enabled only for the testscript files. We cannot run a include file or a test frame. file or a test frame.

We can run a testcase selectively, compile the testscript file and click the “=>t” icon in the tool bar. pile the testscript file and click the “=>t” icon in the tool bar.

To run the entire set of testcases in a testscript file, click the “==>” icon or select the Run - > Run option. Run - > Run option.

If there is any syntax error in the script file, it will show that if you move to the next line of the code. But the other errors are known only at the time of compilation or during the run.“==>” icon or select the Run - > Run option. To open a new or existing

To open a new or existing files In Silktest,

Select the File -> New menu from the menu bar. (or) select from the „white icon‟ in the > New menu from the menu bar. (or) select from the „white icon‟ in the left top corner of the window.

It will ask for various kind of files to open. Select the „4Test include file‟ to declare the window objects from the application. declare the window objects from the application.

The „4Test Script file‟ option is to open the script file where we will be writing testscript. writing testscript.

The above two files are more important for building the scripts.open the script file where we will be writing testscript. Open the application you want to

Open the application you want to test. If you are going to test the Yahoo site, then open the browser load the page you want to start testing.above two files are more important for building the scripts. The page that you start testing

The page that you start testing the application will be assumed as the „BaseState‟. Even we can explicitly declare the window base state. „BaseState‟. Even we can explicitly declare the window base state.

The Test Script file will be used only after creating the include file. We will be using the include file to write the script file. Hence we have to declare the include file that we are calling in the testscript files.Even we can explicitly declare the window base state. To open an existing file, select File

To open an existing file, select File -> Open and select the existing file.to declare the include file that we are calling in the testscript files. SilkTest Tutorials 

an existing file, select File -> Open and select the existing file. SilkTest Tutorials  Sanjay
an existing file, select File -> Open and select the existing file. SilkTest Tutorials  Sanjay

SILK TEST

SILK TEST To write a new plug & play testcase (using Action) This example is to

To write a new plug & play testcase (using Action)

This example is to write the script for logging into the yahoo site.TEST To write a new plug & play testcase (using Action) Sta rt the Silk Test

Start the Silk Test by selecting from the „Start‟ menu. rt the Silk Test by selecting from the „Start‟ menu.

Configure the settings as given in lab I.Sta rt the Silk Test by selecting from the „Start‟ menu. Click „File - > New

Click „File - > New „menu, and select the „4Test script file‟ option. -> New „menu, and select the „4Test script file‟ option.

Click on the OK button.New „menu, and select the „4Test script file‟ option. Start with the keyword „testcase Action ()‟

Start with the keyword „testcase Action ()‟ and press Enter key in your keyboard. The testcase is the default keyword for any testcase and the name Action our keyboard. The testcase is the default keyword for any testcase and the name Action is the name of the testcase. The testcase name can be anything but it is advisable to name it clearly so that will represent the functionality of the test.

Now start writing the testcase (Follow the below instructions)so that will represent the functionality of the test. Open the application in parallel ie., open

Open the application in parallel ie., open the browser in which the application has to run. (say Netscape)start writing the testcase (Follow the below instructions) Go to Silk Test Click Record -> Actions.

Go to Silk Testbrowser in which the application has to run. (say Netscape) Click Record -> Actions. Menu from

Click Record -> Actions. Menu from the menu bar.the application has to run. (say Netscape) Go to Silk Test It will load the „Record

It will load the „Record Actions‟ dialog box.Test Click Record -> Actions. Menu from the menu bar. Keep the dialog box as it

Keep the dialog box as it is, go to the application and do the action what ever you want to perform.menu bar. It will load the „Record Actions‟ dialog box. The silktest will record the events

The silktest will record the events you do sequentially and you can vie it in the „Record Actions‟ dialog. „Record Actions‟ dialog.

After completing your task (till whatever you want to record), click on the „paste to editor‟ button in the „Record hatever you want to record), click on the „paste to editor‟ button in the „Record Action‟ dialog box.

Then click the close button to close the Record actions dialog box and go to your application.to editor‟ button in the „Record Action‟ dialog box. Now the recorded code will be readily

Now the recorded code will be readily available in the testscript editor, inside the testcase.the Record actions dialog box and go to your application. Now delete the keyword „recording‟ in

Now delete the keyword „recording‟ in your first line of the recorded code.available in the testscript editor, inside the testcase. Now, select the entire recorded code by keeping

Now, select the entire recorded code by keeping the mouse arrow at the leftmost dot (.) in your editor at the first line, and drag it till the end.„recording‟ in your first line of the recorded code. Right click on the selected code and

Right click on the selected code and select the „Move Left‟ option.in your editor at the first line, and drag it till the end. The code is

The code is ready now.on the selected code and select the „Move Left‟ option. Now, compile the code from the

Now, compile the code from the „Run - > compile‟ option and run the script by selecting the „Run - > Run‟ -> compile‟ option and run the script by selecting the „Run -> Run‟ menu.

option and run the script by selecting the „Run - > Run‟ menu. SilkTest Tutorials 
option and run the script by selecting the „Run - > Run‟ menu. SilkTest Tutorials 

SILK TEST

SILK TEST Now the testcase will automatically start the application and perform the events recorded and

Now the testcase will automatically start the application and perform the events recorded and throws the results.SILK TEST The sample recorded testcase for yahoo login look like this : Testcase Action ()

The sample recorded testcase for yahoo login look like this :and perform the events recorded and throws the results. Testcase Action ()  // [-] recording

Testcase Action ()sample recorded testcase for yahoo login look like this :  // [-] recording  Browserpage.Set

//

[-] recording

Browserpage.Set Active ()

Browser.Location.Set Text (www.yahoo.com)

Browser.Location. Type Keys (“”)

Yahoo.HtmlLink (“Mail| #26|$http:??www.yahoo.com?r?m2”).Click ()

BrowserPage.HtmlTextField(“Yahoo!ID: | # 1”). SetPosition (1, 1)

BrowserPage.HtmlTextField(“Yahoo!ID: | # 1”). Set Text (“username”)

BrowserPage.HtmlTextField(“Yahoo!ID: | # 1”). TypeKeys („‟‟)

BrowserPage.HtmlTextField(“Password:|#2”).Set Text (“password”)

BrowserPage.HtmlPushButton (“Sign In|#1”). Click ()

The 4 Test language

The 4 Test language is an object-oriented fourth-generation language (4GL) designed specifically with the needs of the QA professional in mind. 4 Test‟s powerful features are organized into three basic kinds of functionality:

A robust library of object-oriented classes and methods that specify how a testcase

A

robust library of object-oriented classes and methods that specify how a testcase

can interact with an application‟s GUI objects.

A set of statements, operators, and data types that you use to add structure and

A

set of statements, operators, and data types that you use to add structure and

logic to a recorded testcase.

A library of built-in functions for performing common support tasks. Note This

A

library of built-in functions for performing common support tasks. Note This

section provides a high-level look at 4 Test.

Running the silkscripts The basic silk scripts will be in two forms. One as an include file and the other as a script file.

be in two forms. One as an include file and the other as a script file.
be in two forms. One as an include file and the other as a script file.

SILK TEST

SILK TEST The include file with the extention *.inc can be used for the declaration of

The include file with the extention *.inc can be used for the declaration of window names, window objects, variables, constants, structures and classes. The core objects of the scripts lies here.

The script file will be used in writing scripts. It will be with the extention *.t. The body of the scripts will be defined here. ie. the testcases that meets various test conditions will be written in the script file. The script file (*.t) can be used for declaring objects and the include file (*.inc) for writing testcases. But to make the code clear we use different files for different purposes. If no testcases is written in a file (include), then the include file can be compiled but cannot be run. It will show error that the file does not contain any testcases. Only the file with the testcase present will be allowed to run.and classes. The core objects of the scripts lies here. Before running the scripts, separate declaration

the file with the testcase present will be allowed to run. Before running the scripts, separate

Before running the scripts, separate declaration file have to be written (for declaring the objects) and the script file (for writing scripts using that declaration file) and compile them. The steps to be followed for running the scripts are as below.

steps to be followed for running the scripts are as below. Open the silk test tool.

Open the silk test tool. Open the script (*.t) file that has to be run. Compile the script by selecting the Run-> Compile menu from the menu bar (or) from the compile icon. It will compile that particular script and the other related files, called by that script. The user can confirm that by looking at the progress status (in yellow color) in the bottom-right corner of the silktest too. If there is any error, the error details are displayed in the compile time. The user has to make necessary changes. Then, select the Run-> Testcase from the menu bar (or) else select the Run icon. The testcases can be run by selectively or at-a-stretch. If the selective method is selected, it will ask for the testcase to be run from a list of testcases. After selecting the testcase and start running, the silktest will automatically start the application and start the test from the basestate. Recording the Events / Action

and start the test from the basestate. Recording the Events / Action SilkTest Tutorials  Sanjay
and start the test from the basestate. Recording the Events / Action SilkTest Tutorials  Sanjay
and start the test from the basestate. Recording the Events / Action SilkTest Tutorials  Sanjay
and start the test from the basestate. Recording the Events / Action SilkTest Tutorials  Sanjay
and start the test from the basestate. Recording the Events / Action SilkTest Tutorials  Sanjay
and start the test from the basestate. Recording the Events / Action SilkTest Tutorials  Sanjay
and start the test from the basestate. Recording the Events / Action SilkTest Tutorials  Sanjay
and start the test from the basestate. Recording the Events / Action SilkTest Tutorials  Sanjay
and start the test from the basestate. Recording the Events / Action SilkTest Tutorials  Sanjay
and start the test from the basestate. Recording the Events / Action SilkTest Tutorials  Sanjay

SILK TEST

SILK TEST Writing scripts in SilkTest includes steps of commands with declaration of window names and

Writing scripts in SilkTest includes steps of commands with declaration of window names and its objects before that. To avoid these difficulties and to make the process easier (this is an alternate for writing line-by-line steps of the scripts) silktest provides a special feature of recording events. The steps are given below.

1. Create a new Testcase.

2. Select the option Record Actions menu.

3. After getting the „Record Actions‟ dialog box, the sequence of steps to be tested, should be done.

4. ie., the programmer has to simply do the ordinary testing process by selecting or using the windows & its objects.

5. After completing these steps, the user has to click the „Paste to Editor‟ button in the „Record Actions‟ dialog box.

6. Now the scripts are automatically available in the script file.

7. Save the script and run that testcase.

A recorded statements for logging in to the yahoo site, will look line the sample given below. [-] recording

site, will look line the sample given below. [-] recording  BrowserPage.SetActive()  Browser.Location.SetText (

BrowserPage.SetActive()

Browser.Location.SetText(www.yahoo.com)

Browser.Location.TypeKeys(“”)

Yahoo.HtmlLink (“Mail|#26|$http:??www.yahoo.com?r?m2”)

BrowserPage.HtmlTextField (“Yahoo!ID:| #1”). SetPosition (1,1)

BrowserPage.HtmlTextField(“Yahoo!ID: | # 1”). Set Text (“username”)

BrowserPage.HtmlTextField(“Yahoo!ID: | # 1”). TypeKeys („‟‟)

BrowserPage.HtmlTextField(“Password:|#2”).Set Text (“password”)

BrowserPage.HtmlPushButton (“Sign In|#1”). Click ()

The alternate for the above recorded statements will be as below:

Browser.Loadpage ( www.yahoo.com ) // Loads the yahoo homepage as the default page (www.yahoo.com) // Loads the yahoo homepage as the default page

if Yahoo.Exists() // checking for the existence of the homepage( www.yahoo.com ) // Loads the yahoo homepage as the default page SilkTest Tutorials  Sanjay

page if Yahoo.Exists() // checking for the existence of the homepage SilkTest Tutorials  Sanjay Kumar
page if Yahoo.Exists() // checking for the existence of the homepage SilkTest Tutorials  Sanjay Kumar

SILK TEST

SILK TEST prin t (“Yahoo window exists”) // confirming that the window exists Yahoo.objYahoo.Loginname.SetText

print (“Yahoo window exists”) // confirming that the window exists t (“Yahoo window exists”) // confirming that the window exists

Yahoo.objYahoo.Loginname.SetText (“username”)window exists”) // confirming that the window exists Yahoo.objYahoo.Password.SetText (“password”)

Yahoo.objYahoo.Password.SetText (“password”)exists Yahoo.objYahoo.Loginname.SetText (“username”) Yahoo.objYahoo.Submit.Click() The difference between the

Yahoo.objYahoo.Submit.Click()Yahoo.objYahoo.Password.SetText (“password”) The difference between the above two different scripts are,

The difference between the above two different scripts are, the method II needs windows & its objects to declared before the scripts are to be written. It is not in the case of the recording kind of the code.

SILK TEST FEATURES

Platform Independent

Silk Test doesn‟t care about how the application is created, in which software the application is written, what kind of design is used, which browser it is being worked, in which operating system the application is running.

All that needs for an application to be tested using silktest is that it needs a frame (like window)

Browser Independent

There are various kinds of browsers used by various people for running their applications. The user may use any browser of his choice to test the standard application. Each and every browser acts differently with different applications. They show the same page differently. The web objects they display can also be aligned or displayed in different manner. SilkTest just looks at these browser contents as objects and hence they cannot avoid any images, texts,… that they are not identifiable. Also we can write a test in one browser and run it in any other browser (to some extend). i.e…, using SilkTest, we can do cross browser testing.

With minor modifications, your tests are robust enough to support different browsers and different versions of these browsers.

to support different browsers and different versions of these browsers. SilkTest Tutorials  Sanjay Kumar Page
to support different browsers and different versions of these browsers. SilkTest Tutorials  Sanjay Kumar Page

SILK TEST

SILK TEST Technology Independent Silktest does not care how the application was built. It seamlessly works

Technology Independent

Silktest does not care how the application was built. It seamlessly works with the different web technologies commonly used today.

How to use the same code for multiple browsers:

Start writing the silk scripts. Capture the window declarations (.inc file) and write the .t file. Say if you are capturing the declarations from Internet Explorer & run successfully on it. As we captured the declarations from I.E., we now have to make the same test case run on Netscape since the tag value changes from multiple browsers.

Testing the Windows based applications Before start writing scripts, enable the settings given below.

1. Declare all the window names and its objects (used in writing scripts) starting from the first window.

2. In the File-> New option in the menu bar, select the test frame.

3. In the resulting „new Test Frame‟ dialog box, specify the path of the executable file of your application.

4. After submitting that dialog box, the silktest will automatically create a declaration file with the default window declared.

5. Use that file to create your testscripts.

Testing the Java based applications Before you start testing the java applications or applets, you have to set the java classpath.

Point to a Java archive (.jar file) that contains the software the powers SilkTest‟s Java support for JDK 1.2 and r file) that contains the software the powers SilkTest‟s Java support for JDK 1.2 and JRE 1.2. This file is called SilkTest_Java2.jar.)

When you install SilkTest_Java2.jar is installed in this directory:<SilkTest install directory>\JavaExsupport for JDK 1.2 and JRE 1.2. This file is called SilkTest_Java2.jar.) SilkTest Tutorials  Sanjay

is installed in this directory:<SilkTest install directory>\JavaEx SilkTest Tutorials  Sanjay Kumar Page 22
is installed in this directory:<SilkTest install directory>\JavaEx SilkTest Tutorials  Sanjay Kumar Page 22

SILK TEST

SILK TEST If you will use only JDK 1.2 for testing, you can activate Java support
SILK TEST If you will use only JDK 1.2 for testing, you can activate Java support

If you will use only JDK 1.2 for testing, you can activate Java support for JDK 1.2 by copying SilkTest_Java2.jar from <SilkTest install directory>\JavaEx to <JDK 1.2 install directory>\jre/lib/ext.

If you do not copy SilkTest_Java2.jar to your JDK 1.2 install directory, you must point to it from your CLASSPATH.

your JDK 1.2 install directory, you must point to it from your CLASSPATH. SilkTest Tutorials 
your JDK 1.2 install directory, you must point to it from your CLASSPATH. SilkTest Tutorials 