Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 21

Software Test Automation using

SilkTest
Week 10
Test Plans
A testplan is a structured, usually hierarchical,
document that describes the test requirements and
contains the statements (4Test scripts and testcases)
that implement the test requirements. A testplan is
displayed in an easy-to-read outline format, which lists
the test requirements in high-level prose descriptions.
The structure can be flat or many levels deep.
Indentation and color indicate the level of detail and
various testplan elements.
Large testplans can be divided into a master plan and
one or more subplans.
A testplan file has a .pln extension.
Test Plans
When you structure your testplan as a hierarchical outline you:
◦ Assist the testplan author in developing thoughts about the test
problem by promoting and supporting a top-down approach to test
planning
◦ Yield a comprehensive inventory of test requirements, from the most
general, through finer and finer levels of detail, to the most specific
◦ Allow the statements that actually implement the tests to be shared by
group descriptions or used by just a single test description
◦ Provide reviewers with a framework for evaluating the thoroughness
of the plan and for following the logic of the testplan author

 - From SilkTest help files


Test Plans
List
Structure
[-] Notepad application, About Box
[ ] script: Test.t
[ ] testcase: About
[-] Notepad application, Find dialog box
[ ] $Number = 1
[ ] $Color = RED
[ ] script: Test.t
[ ] testcase: FindDialog
[-] Notepad application, Replace dialog box
[ ] script: Test.t
[ ] testcase: ReplaceDialog
Test Plans
Hierarchical
 Structure
[-] Notepad application tests
[-] About dialog tests
[-] Version Test case
[ ] script: Test.t
[ ] testcase: About
[-] Copyright test case
[ ] script: Test.t
[ ] testcase: About
[-] Find dialog box
[-] Find Next button test case
[ ] $Number = 1
[ ] $Color = RED
[ ] script: Test.t
[ ] testcase: FindDialog
[-] Match Case button test case
[ ] script: Test.t
[ ] testcase: FindDialog
[-] Replace dialog box
[-] Replace All button test case
[ ] script: Test.t
[ ] testcase: ReplaceDialog
[-] 'Find What' and 'Replace With' test case
[ ] script: Test.t
[ ] testcase: ReplaceDialog
Structure of a test plan
Element Description Color
Comment Provide documentation Green
throughout the testplan; preceded
by //
Group Description High level line in the test Black
requirements outline that
describes a group of tests
Test Description Lowest level line describing a Blue
single testcase; is a statement of
the functionality to be tested by
the associated testcase

Test Plan Used to provide script name, Red when a subplan is


Statement testcase name, test data, or not expanded
include statement  
  Magenta statement
when subplan is
expanded
Linking a test plan to test scripts
Right click anywhere in the test plan and click
“Test Detail…”
In the “Test Execution” tab, click on
“Scripts…” and select the correct script file.
(.t file)
Then, click on “Test Cases…” and choose the
correct test case.
For data-driven test cases, you can also
specify the set of rows from the spread-sheet
(by default all rows are selected)
Linking a test plan to test script
If you already know the script name and
the test case names, you can manually
type in the test plan editor
◦ Group level descrtiption
 This is test 1
 script: testscript.t
 testcase: testcase1
 This is test 2
 script: testscript.t
 testcase: testcase2
Test Plan
Example Work-through in the class
Remote Execution
SilkTest scripts can be run on a remote
machine which the script is executed on the
local machine.
This feature is extremely powerful in a
networked environment, or in a distributed
testing environment.
For this to work, the remote machine should
already have the agent installed and running,
the complete silktest installation is not
necessary.
Remote Execution
Please note: When you run a test on a
remote computer, you are using two
licenses, not one.
Windows firewall should be unblocked on
the remote computer to allow the SilkTest
program to accept connections from the
local computer.
Remote Execution
Torun a particular test script on a remote
machine, perform the following steps:
On the local computer:
◦ Open the project file, go to Options -> Runtime…
◦ The agent name field. By default it is “(local)”.
Here enter the IP address or the name of the
computer.
 You can get the name and IP address of the computer by
using the command “ipconfig” at the DOS shell.
◦ Click OK and exit the Runtime options dialog box.
Remote Execution
On the remote computer:
◦ Start the agent that the test case requires:
 Start->All Programs ->Silk -> SilkTest 2009 R2 ->
SilkTest Open Agent.

Or

Start->All Programs ->Silk -> SilkTest 2009 R2 ->


SilkTest Classic Agent
Remote Execution
Now on the local computer, click Run ->
Run. You can observe that the execution is
occurring on the remote computer.
When the execution is complete, the test
results are displayed on the local
computer.
Remote Execution – Dynamic connection
You can use “Connect” and “Disconnect”
commands to dynamically connect and
disconnect to the remote machines.
◦ This is handy when you need to connect to
multiple machines during the execution of a
test case.
Remote execution – Dynamic Connection
Connect command
◦ Establishes a connection to a specific
machine.
◦ hMachine = Connect([sMachine,
sAgentType])
◦ Where sMachine is the remote machine name
or IP address.
◦ sAgentType is either set to OPEN_AGENT or
CLASSIC_AGENT. If this is not supplied, the
default agent from the project is used.
Remote execution – Dynamic Connection
Disconnect command
◦ Establishes a connection to a specific
machine.
◦ Disconnect(hMachine)

◦ Where hMachine is the handle to the machine


to disconnect from (the returned value of the
Connect command).
GetMachine
◦ Returns a handle to the current machine
◦ hMachine = GetMachine()

SetMachine
◦ SetMachine(Machine)
 Where Machine is the handle to be set as the current
machine. It can be a handle to the machine or a
string with the machine name/IP address.
Remote Execution
Misc info – The behaviour of the agent
for remote connections has been changed
starting in SilkTest 2009.
◦ Earlier the users/programmers could specify
the TCP port number on which to start the
agent.
◦ But starting SilkTest 2009, the TCP port is
dynamically allocated by the .
Remote execution – Dynamic Connection
Example work-thru in the class
Misc.
If I copy over an antire SilkTest project directory to a different location path, how come I am unable
to execute and run test cases from the new directory?
Answer: Please perform the following steps:

1. First copy over the entire folder to your destination location.


2. Then open the .ini file in Notepad application, and remove all refereces to the original location, and
replace with the new location.
For example: Change the line:
 CurrentProject=\\district5\silk\Bhava\Week7\WPFNotepad\WPFNotepad.vtp
to
CurrentProject=<the new location of the project>\WPFNotepad.vtp
 
UseFiles=\\district5\silk\Bhava\Week9\AutomobileQuote\frame.inc,extend\WIN32\WIN32.inc,extend\xBrowser\xbrowser.inc
to
UseFiles=<the new location of the project>\frame.inc,extend\WIN32\WIN32.inc,extend\xBrowser\xbrowser.inc

 Change the line:


LastFile1=Open \\district5\silk\Bhava\Week7\WPFNotepad\tests.t
to
LastFile1=
(this setting tells silktest which file to automatically open in the editor when you open the project file. By leaving it blank if will not
automatically open anything in the editor).
 
Remove all other references also.
3. Delete all the tempory files in the directory. This is all files ending with .bak, .res, .t_, .to, .txt, .in_, .ino,
.s_, .pl_.
4. Now open the project file (.vtp file) in SilkTest, open the necessary test script file (.t file), and then Run the
test case. It should run.

You might also like