Tuesday, June 9, 2009

Script Services

Script Services

By Renu Bala

Script Support Functions enables you to insert code into Functional Tester Script to perform variety of tasks. These tasks include:

• Calling a script from a Functional Test Script
• Inserting Log Messages into Functional Test Script
• Using timers with Functional Test Script
• Setting delays and sleep states for Functional Test Script Playback
• Inserting comments into Functional Test Script

The Script Support Functions dialog box has following tabs:

1. Call Script for Calling a script from a Functional Test Script
2. Log Entry for Inserting Log Messages into Functional Test Script
3. Timer for Using timers with Functional Test Script
4. Sleep for Setting delays and sleep states for Functional Test Script Playback
5. Comment for Inserting comments into Functional Test Script

To use script support commands Click on Insert Script Support Commands button on Recording Monitor Toolbar.

Call Script
While recording or editing a functional test script, you can insert a call to a previously recorded script. This lets you avoid repeatedly recording similar actions on the AUT by taking advantage of scripts that already exist.
CallScript inserts following code in the script at the cursor location:

callScript (“scriptname”)
Where scriptname is the name you selected in the script name field.

Log Entry
You can insert a log message into a functional test script and indicate whether it is a message, a warning or an error. During playback, RFT inserts this information into the log.
LogEntry inserts the following code into the script based on the option you selected (message, warning, error):

logInfo(“Message”)
logWarning(“Message”)
logError(“Message”)
Where Message is the text you entered

Timer
You can insert timers with different names into the same script to measure time it takes to perform a variety of separate tasks. You have to explicitly stop the timer to calculate the time taken by the set of events.
The code generated is:
timerStart(“name”)
timerStop(“name”)
Where name is the variable name you want to use for the timer.

Sleep
You can insert sleep command into Functional test script to delay the script for specified time.
The code generated is:
Sleep(seconds)
Where seconds is the time entered in seconds fields.

Comment
During recording or editing, you can insert lines of comment text into RFT script. Comments are helpful for documenting and editing scripts. It inserts the text with appropriate comment delimiter (//) preceding each line.


Info

http://www.qacampus.com

http://www.crestech.in

Software Testing

Australia

0 comments: