Você está na página 1de 15

Features of Silk Test: Product : Seague Software Version: 7.

1 Latest Version: 2006 Purpose: Functionality and Regression Testing Tool Kinds of Application: All kinds of Application (Both Window Based and Web Based Application) Platform Independent Tool Language: 4 Generation Language Components of Silk Test: Silk test Host S/w: The Host is the Software that is used to create and modify the test plan , frame, script, suite files. It is mainly used to interact between the application under test (AUT) Silk test Agent S/W: The Agent is the software process that translates the commands in your 4Test scripts into GUI-specific commands. In other words, it is the Agent that actually drives and monitors the application you are testing. Silk Test Process 1) Creating a Test Project 2) Creating a Test Plan 3) Recording the Test Frame

4) Creating Test Script 5) Modifying The Test Script 6) Executing the Test Script 7) Analyse the Test Result Project: Silk Test project Contains a relevant information about the project including references to all the Resources associated with a test set, such as test plan, frame file, scripts, Results, Data. Project Files will be stored in the extension .vtp(verify test project) Creating a project: File New Project Select Create Project Specify the Name of the project , Description, Location of the project Click OK Creating a Test Plan Testplan is an outline that organizes and enhances the testing process; references testcases and allows execution of testcases according to the testplan detail. Test plan is stored in the extension .pln File New Test Plan Design the Test Plan Recording the Test Frame Recording a test frame will create a Include file automatically captures a declaration of the AUTs main window. 1.File New Test Frame 2.Start programsSilk Test Sample Application Text Editor

3.Place The Application in the Application area of the Test Frame Test Frame is stored in the extension .inc Creating Test Script Contains recorded and hand-written automated testcases , written in 4Test language, that verify the behavior of the AUT. The way the application is getting opened in silk test is called Base State 1.File New 4 Test Script 2.Save the Test Script 3.Record Testcase Start Recording perform some task in the application 4.Record Status window click Done. 5.Paste to Editor Test script must be stored in extension .t Executing The Test Script It is the process of running the testcase. Analyse the Test Result: Is automatically created to store a history of results for a testplan or script execution. Quality Organiser: It is the process of linking the test script and run the test script as per the test plan 1.File New Test Plan 2.Specify the Menus and Sub menus(object) 3.To align the object 4.outline-> Move Left or outline-> Move Right 5.Rightclick-> Test Plan->test detail->browse the script->browse the test cases

6.run the testplan Application State: An application state is the state you want your application to be in after the base state is restored but before you run one or more testcases. a. Default Base State 1.File New 4 Test Script 2.Save the Test Script 3.Record Testcase Start Recording perform some task in the application 4.Record Status window click Done. 5.Paste to Editor b. None Open the Text editor Application File New 4 Test Script 2.Save the Test Script 3.Record Testcase change the Application State As None->Start Recording perform some task in the application 4.Record Status window click Done. 5.Paste to Editor 6.Run the test in the opened application Verification Point:

It is the process of checking the Expected result versus Actual Result 1.Object verification point 2.object data verification point 3.Alphanumeric verification point 4.Menu verification point 5.Bitmap verification point Object Verification point : It captures the objects presented in the application under test. It compares the properties of an object 1.open the test script 2.record->start recording 3.press ctrl+Alt 4.In the verify window change the properties name(Enabled,visible) Object Data Verification point: It captures the object presented in the application under test. It compares the data presented in the object. Object data verification point is mainly used to test the object that contain multiple values like for eg: Combo Box, Drop Down List Box 1.open the test script 2.record->start recording 3.File->open ,place the cursor in list of file type 4.press ctrl+Alt 5.In the verify window change the properties(Content property) Menu Verification point: It captures the menus presented in the application. It checks the properties of the menu presented in the application

1.open the test script 2.record->start recording 3.Place the cursor in the menu bar 4.press ctrl+Alt 5.In the verify window change the properties Menu(Interchange the position of menus) Alphanumeric Verification Point: It is used to check the field contains alphabetic or numeric data. 1.open the test script 2.record->start recording 3.Type some Text in the Text Area 4.press ctrl+Alt 5.In the verify window change the properties (Multitext) Bitmap Verification point: It compares the two images presented in the application and show the differences between the two images. It is mainly used to test the Confidential information of the application 1.Create Two Bitmap Images 2.open the silk test Bitmap Tool. 3.open both the Images(File->open) 4.select differences->show 4th-Generation Language: SilkTests 4Test language is an object-based fourth-generation language (4GL) designed specifically to meet complex testing needs. All tests within SilkTest, whether recorded or scripted, are created using 4Test. 4Test includes a set of statements, operators and data types that add structure and logic to recorded testcase.4Test language offers all the commands, data types and functionality that you would expect from a leading-edge programming language. Data Types: It is used to store the appropriate data in the specified type

INTEGER -NUMBERS REAL -Number NUMBER -Number DATE -Date TIME -Time STRING-Alphabets WINDOW Name of the window DATETIME-date and Time ANYTYPELIST-Any data ARRAY -Collection of Data BOOLEAN -True or False SET -used to set some value BROWSERTYPE-Returns browser Name DATACLASS-parent window LIST-List of items LONG -Numbers TABLECOL -reterive the column value TABLEROW- reterive the row value

BASIC: [-] testcase addition() [ ] integer a = 10 [ ] integer b = 20 [ ] integer sum [ ] sum=a+b [ ] //print(sum) [ ] print("Value of sum is {sum}") ---------------------------------------------[-] testcase ForEx() [ ] integer i [-] for(i=10;i>=1;i--) [ ] print(i) ----------------------------------------------[-] testcase ForeachEx() [-] list of string tools={...}

[ ] "WinRunner" [ ] "SilkTest" [ ] "Rational Robot" [-] string t [-] for each t in tools [ ] print(t) ---------------------------------------------[-] testcase WhileEx() [ ] integer num=10 [-] while(num>=1) [-] if num%2 !=0 [ ] print("{num} is Odd") [-] else [ ] print("{num} is Even") [ ] num---------------------------------------------------[-] testcase IfEx() [ ] integer a=10 [-] if a%2==0 [ ] print("Even") [ ] print (a) //prints the value of a [ ] print("The Value of a is {a}")// prints a string along with the value [-] else [ ] print("Odd") [ ] print (a) [ ] print("The Value of a is {a}") ------------------------------------------------------[-] testcase switchex() [ ] string str="a" [-] switch(str) [-] case "a" [ ] print("It is a Vowel") [-] case "e" [ ] print("Vowel") [-] case "i" [ ] print("Vowel")

[-] default [ ] print("It's Not a Vowel Char)

Data Driven Test Case: It is used to pass Multiple Values to the Field under Test. 1.Create the database(With the Field name as Find) 2.Create the data source name(DSN) 3.File New 4 Test Script 4.Save the Test Script 5.Record Testcase Start Recording Type some Phrase search->find specify the word for search.close the application 6.Record Status window click Done. 7.Paste to Editor 8.Select the keyword Right click select Data driver testcase. Exception Handling: An Exception is an interruption occurs while running the program To overcome the exception we need to perform some Recovery procedures. 1.File New 4 Test Script 2.Save the Test Script 3.Record Testcase Start Recording perform some task in the application and save the script 4.Record Status window click Done. 5.Paste to Editor 6.do

----------------Except MessageBox.SetActive() MessageBox.Yes.Click()

Regression Testing: It is used to call multiple test script and execute into a single suite file. File->new->suite->Type the script name Run the script,testplan FUNCTIONS: 1.User Defined function [ ] //Example For Userdefined Functions 1.file->new->4test include file. [-] Integer max1(integer a,integer b) [-] if(a>b) [ ] return a [-] else [ ] return b 2.save the file. 3. file->new->4test script use userdefinedfilename.inc [-] testcase Sample() [ ] integer a=30

[ ] integer b=20 [ ] integer ret [ ] ret=max1(a,b) [ ] print("Maximum number is {ret}") save the file. 2.Predefined Function: String Functions: [+] testcase s1 () [-] STRING s = "Hello World" [ ] Print (Right (s, 5) ) // prints: World [ ] Print (Right (s, 20) ) // prints: Hello World [+] testcase s2() [-] STRING s1 = "Segue Software" [ ] Print (Left (s1, 5)) // prints: Segue [ ] Print (Left (s1, 20)) // prints: Segue Software [+] testcase s3() [-] STRING sName [ ] sName = "Segue" [ ] Print (Len (sName)) [+] testcase s4() [-] STRING s2 = " Has whitespace " [ ] Print( "{LTrim (s2)}") [-] STRING s6 = " Has whitespace " [ ] Print( ">{Trim(s6)}<") // prints: >Has whitespace< [+] testcase s5() [ ] Print ("Four A's -> {Replicate ("A", 4)}.") [+] testcase s6() [-] STRING s3 = " Has whitespace " [ ] Print( ">{RTrim(s3)}<") // prints: > Has whitespace< [-] Print ("12345678901234567890")

[ ] Print ("12345" + Space (10) + "67890")//Returns the specified number of space characters. [+] testcase s7() [-] STRING s4 = "now is the time for all the good men" [ ] //search forward to find first occurrence of "the" [ ] Print (StrPos ("the", s4)) // prints: 8 [ ] //search backward to find second occurrence of "the" [ ] Print (StrPos ("the", s4, TRUE)) // prints: 25 [ ] Print (StrPos ("x", s4)) // prints: 0 [ ] //Searches for and replaces characters in a string. [-] STRING s5 = "one and two and three" [ ] Print (StrTran (s5, "and", "&" )) [ ] // prints: one & two & three Right -Returns the right-most characters of a string. Left- Returns the left-most characters of a string. Len - Returns the length of a string. Ltrim - Strips leading whitespace from a string. Rtrim - Strips trailing whitespace from a string. Trim - Strips leading and trailing whitespace from a string. Strpos - Returns the position of the specified substring. StrTran - Searches for and replaces characters in a string. Replicate - Replicates a string the specified number of times. Space - Returns the specified number of space characters. 2.[-] testcase StringFun() [ ] string str1="WinRunner|SilkTest|Astra QiuckTest" [ ] string str2="Welcome" [ ] boolean boo,digit [ ] boolean boo1,boo2 [ ] print(GetField(str1,"|",2)) [ ] print(len(str2)) [ ] boo=IsAlpha("Hello") [ ] print("Value of IsAlpha is {boo}") [ ] digit=IsDigit("23ddff") [ ] print("Value of Isdigit is {digit}")

[ ] boo1=IsSpace(" ") [ ] print("Value of IsSpace is {boo1}") [ ] boo2=Matchstr("*Hello*","Hi Hello there") [ ] print("Value of Matchstr is {boo2}") [ ] INTEGER i = 1 [-] ARRAY[2] OF STRING asFruit = {...} [ ] "apples" [ ] "orange" [ ] Print (IsArray(asFruit)) [ ] Print (IsArray(i)) [-] LIST liItem = {...} []1 []2 []3 [] [ ] INTEGER i = 0 [ ] Print (IsList (liItem)) [ ] Print (IsList (i)) Get Field - Returns a segment (field) of a string. IsAlpha- Tests whether the first character of a string is an alphabetic character. IsDigit- Tests whether the first character of a string is a digit. IsSpace - Tests whether the first character of a string is a whitespace character. Matchstr - Looks for a pattern in a string. IsArray-Tests whether an expression is an array. IsList- Tests whether an expression is a list. File Handling: Fileopen- Opens a file on the host system. FileClose- Closes a file on the host system.

FileWriteValue- Writes structured data (for example, a 4Test record) directly to a file on the host system. FileWriteLine- Writes a line of text to a file on the host system. FileReadValue- Reads structured data (for example, a 4Test record) directly from a file on the host system. FileReadLine- Returns the next line of a file on the host system. [-] testcase FileEx() [ ] HFILE FileHandle [ ] FileHandle=FileOpen("C:\SilkTest.txt",FM_WRITE) [ ] FileWriteLine(FileHandle,"Welcome To SilkTest") [ ] FileClose(FileHandle) [ ] integer a=10 [ ] integer b=20 [ ] integer c=a*b [ ] FileHandle=FileOpen("C:\SilkTest.txt",FM_APPEND) [ ] FileWriteValue(FileHandle,c) [ ] FileClose(FileHandle) [ ] String SLine [ ] FileHandle= FileOpen("C:\SilkTest.txt",FM_READ) [ ] FileReadLine(FileHandle,SLine) [ ] print("Line is {SLine}") [ ] FileReadValue(FileHandle,c) [ ] print("Value is {c}") [] Date and Time Functions [-] testcase DateTimeEx() [ ] datetime dtnow=GetDateTime () // returns date in yyyy/mm/dd format &time in hh/mm/ss [ ] print("The Current Date and Time is {dtnow}") [ ] datetime dt=AddDateTime (GetDateTime(),2) [ ] print("2 days will be added to the Current Date {dt}") [ ] string format=FormatDateTime (dtnow,"hh:mm:ss AM/PM") [ ] print("Changed Date Format is {format}") [ ] integer dd=GetDateTimePart (dtnow, DTP_YEAR) [ ] print("Output of GetDateTimePart is {dd}")

[ ] String Date1=Datestr() // mm/dd/yy [ ] print("Only Date {Date1}") [ ] string Time1=Timestr() // hh:mm:ss [ ] print("Only Time {Time1}") -------------------------------------------------------------Window Functions [-] testcase WindowFunEx() [ ] print(ClassOf(TextEditorUntitled)) [ ] print(WindowParent (Find)) [ ] print(WindowChildren(TextEditorUntitled)) Database Functions: [-] testcase oo() appstate none [ ] handle hh [ ] handle hh1 [ ] hh=DB_connect("DSN=data1") [ ] hh1=DB_executesql(hh,"select one from [Sheet1$]") [ ] string s [-] while db_fetchnext(hh1,s) [ ] print(s) [ ] db_finishsql(hh1) [ ] db_disconnect(hh)

Você também pode gostar