• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Winrunner
 

Winrunner

on

  • 1,695 views

 

Statistics

Views

Total Views
1,695
Views on SlideShare
1,695
Embed Views
0

Actions

Likes
0
Downloads
184
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft Word

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Winrunner Winrunner Document Transcript

    • WIN RUNNERFeatures of Winrunner:Product: Mercury Interactive or Hewlett Packard(HP)Purpose: Functionality and Regression Testing ToolKinds of application: All kinds of application (web Based and Window Based).Language:Test Script LanguageTechnology: Object oriented TechnologyObject Oriented Technology:It will recognise each and every control/field present in the application as an object.Each and every object present in the application has its own properties. The objectand their properties are get stored in the GUI Map File. Map File is the heart of thewinrunner.Generating Map File:Rapid Script Wizard:The RapidTest Script Wizard will "walk through" your application by automaticallyopening windows and dialog boxes. It will examine every GUI object (for example,buttons, lists, and edit fields) and will learn a unique description of each one.RecordingContext Sensitive:WinRunner records the operations you perform on the GUI objects in yourapplication, and inserts the appropriate TSL statements into your test script.1.Rec->start->programs->winrunner->sample applications->flight 4a2.specify agent name and password3.click ok4.insert an order5.file->exit6.stop the recordingAnalog:WinRunner records the operations you perform on your application, includingkeyboard input, mouse clicks, and the exact coordinates of the mouse pointer as ittravels across your screen.1.Rec->start->programs->winrunner->sample applications->flight 4a2.specify agent name and password3.click ok
    • 4.file->open order, specify order no, click ok5.file->fax order ,specify the fax number6.click the record icon(context->analog)7.put agent signature.8. click the record icon(analog->context)9.click send10.file->exit11.stop the recordingGUI Map Editor:Enables you to view the contents of the GUI Map and to load and maintain GUI Mapfiles.  Tools-Gui Map editor  Open the application  Use the learn tool to capture the application.GUISPY:Opens the GUI Spy, enabling you to view the properties of GUI objects in yourapplicationTools->gui spyOpen the applicationUse the spy icon to capture the objectpress ctrl(L)+f3 to stop capturing.Merging Map Files:The GUI Map File Merge Tool enables you to merge multiple GUI map files into asingle GUI map file. GUI Map File Manual Merge Tool This tool opens after you chose to merge multiple GUI map files into a single GUI map file using the Manual Merge merge type. Tools->merge Gui map files Click ok Select merge type as Manual Browse the Target and Source File Click ok Select the object and click copy Click close GUI Map File Auto Merge Tool This tool opens after you tried to merge multiple GUI map files into a single GUI map file using the Auto Merge merge type, only if The merge tool found conflicts among the source GUI map files being merged.
    • Tools->merge Gui map files Click ok Select merge type as Auto Browse the Target and Source File Click okSynchronization Point:Synchronization points enable you to solve anticipated timing problems between thetest and your application.Tools->general options->settings->timeout for check point ->50001.Rec->start->programs->winrunner->sample applications->flight 4a2.specify agent name and password3.click ok4.insert an order5.file->exit6.stop the recording7.Insert->synchronization point->for object/window place the cursor in the object8.change the value-1 Time-10 and click paste9.Run the testCheckPoint:It is used to compare the expected Result versus Actual Result.GUI Checkpoint For Single Property: The property check verifies the value of a single property of a GUI object. Insert->gui checkpoint->single property Use the hand icon to select the object, Change the expected value For Object/Window: The checkpoint checks a single object or window in your application. Insert->gui checkpoint->from object/window Use the hand icon to select the object, Change the expected values For Multiple Objects (Create GUI Checkpoint dialog box): The checkpoint checks multiple objects in your application. Insert->gui checkpoint->for Multiple objects, click add object Use the hand icon to select the object Change the expected values Get Text
    • From Object/Window:The text retrieval statement reads the text displayed in a window or in aGUI object in your application.1.Rec->start->programs->winrunner->sample applications->flight 4a2.Insert->get text->from object/window3.select the static text4.close the application5.stop the recordingif (text=="UserName:") printf("Valid user"); else printf("InValid user");From Screen Area:The text retrieval statement reads the text displayed in a specified area onyour screen.Bitmap CheckpointFor Object/WindowInserts a bitmap checkpoint into your test script. The checkpoint checks asingle object or window in your application.1.Rec->start->programs->winrunner->sample applications->flight 4a2.specify agent name and password3.click ok4.Help->about5.Insert->bitmap check point->for object/window6. Use the hand icon to select the object.7. Close the application8.stop recording9.change the application from flight 4a/4bFor Screen Area:Inserts a Bitmap checkpoint into your test script. You specify an area onyour screen that the checkpoint will check.1.Rec->start->programs->winrunner->sample applications->flight 4a2.specify agent name and password3.click ok4.Help->about5.Insert->bitmap check point->for object/window6. Draw the region u want to capture7. Close the application
    • 8.stop recording9.change the application from flight 4a/4bDatabase Checkpoint :Default Check:Inserts a database checkpoint into your test script.Use a default database check to check the entire contents of a databaseassociated with your application.Insert->databasecheckpoint->default checkClick okSelect the dsn (Flight32)->okSelect the orders table->select the fieldClick nextSelect order number-> less than equals to->some value (20)Click nextSort by order no->nextFinishRun the testDouble click the end databaseDatabase checkpoint window right click Edit Expected Data changethe valueRun the testChange it to update modeRun the testChange it to Verify modeRun the testCustom Check:Inserts a database checkpoint into your test script. The checkpoint checksspecified properties of the database.Use a custom check to:· check the number of rows in a database· check the number of columns in a database· check specific information in the database
    • Insert->databasecheckpoint->Custom checkSelect specify sql statementClick nextClick createMove to machine data sourceSelect flight32 dsnClick okSpecify the query as“Select * FROM ORDERS”Click finishIn the check databaseChange the expected valueRun the testRun Time Record Check:The Runtime Record Checkpoint wizard, which enables you to insert aRuntime Database Record checkpoint into your test script. Thecheckpoint captures information from your application during the test runand checks it against the corresponding record(s) in the database.1.Rec->start->programs->winrunner->sample applications->flight 4a2.specify agent name and password3.click ok4.insert an order5.Insert->databasecheckpoint->Run time record check6.Click next7.Select the dsn (Flight32)->ok8.Select the orders table->select the field9.Click next10.Select order number-> equals to->order number (inserted duringrecording)11.Click next12.click next13.Finish14.Use the hand icon to select the field-.click next15.perform the above for all the value16.close the application17.stop recording18.run the test.Data Driver:
    • Enables you to parameterize lines in your test script so you may run yourtest in a loop with different sets of data.1.Rec->start->programs->winrunner->sample applications->flight 4a2.specify agent name and password3.click ok4.insert an order5.file->exit6.stop the recording7.table->datadriver wizard8.click next until you reach Agent name->select new column9.click next. -> Perform the above specified for other field also10.select show datatable now11.specify the values.12.run the test.Regular Expression:Regular expressions enable WinRunner to identify objects with varyingnames or titles. A regular expression is a string that specifies a complexsearch phrase1.Rec->start->programs->winrunner->sample applications->flight 4a2.specify agent name and password3.click ok4.insert an order5.file->fax order->specify fax number->lick send6. Close the application.7.stop the recording8.change the modification !Fax Order No. [0-9]*9.Tools->Gui map editor->select the object->click modify->change inboth physical and logic description.Break Point:Adds or removes a breakpoint to or from the line where the cursor iscurrently located.1.Place the cursor in the regular Expression script2.Right click->select Toggle Break point.3.Run from Top4.To execute from Break point->Run from ArrowCompiled Modules:
    • Verify: Checks your application . This mode is relevant only for tests andis not supported when working with components.Debug: Debugs your test or component script.Update: Updates the expected results.Dialog Boxes:a=create_input_dialog("Enter the name");report_msg(a);b=create_password_dialog("userName","Password",l,p,1);report_msg(l);report_msg(p);c=create_browse_file_dialog("*.*");report_msg(c); d=create_list_dialog("Welcome to STC","courseDescription","CATE+,CATE,ADST,CSTP"); report_msg(d);File Handling:file_open("C:readme.txt",FO_MODE_READ);file_open("C:readme2.txt",FO_MODE_WRITE);i=0;while(file_getline("C:readme.txt",line)==0){i++;file_printf("C:readme2.txt","%d "&toupper(line),i);}file_close("C:readme.txt");file_close("C:readme2.txt");User Defined Functions
    • public function multiple(a,b){auto c;c=a*b;return c;}file->Test properties->testtype->Compiled Module.Save the testload("func1");x=create_input_dialog("Enter a number");y=create_input_dialog("Enter a number");z=multiple(x,y);report_msg(z);save the testDebug options:Step:The Step command assists with test script debugging by enabling you toobserve the response of your application as WinRunner executes each testscript line.Step Into:Step Into command assists with test script debugging by enabling you toobserve the response of your application as WinRunner executes each testscript line.Step out:Step Out command to eliminate the need to execute a called test orfunction line-by-line using the Step and Step Into commands.Step to cursor:Step to Cursor command assists with test script debugging by letting yourun a pre-defined section of a test script.Recovery Scenario:An exception is an interruption occurs while executing the test.
    • An Interruption may be a window exception and application exception.To overcome the exception we need to perform some recovery stepsPopup event: A specific window that pop ups during test run and interrupts the test.1.Rec->start->programs->winrunner->sample applications->flight 4a2.specify agent name( less than 4 characters) and password3.click ok(Error window)4. specify agent name5. click ok6.close the application7.stop recording8.comment the line where you click ok in the error window9.Run the test10.click pause11.Tools->recovery Manager.12.click new13.select popup->next->specify scenario name->next14.select the window->next->select the ok button->next-> finish15.un the test.TSL event: A TSL return value that can cause an interruption in the test run.1.Rec->start->programs->winrunner->sample applications->flight 4a2.specify agent name and password3.click ok4.insert an order5.In the script Copy the Fly from Location Line, change the Fly FromLocation.(List_Select_item)6.Run the test.7.Click ok in the error window8.Tools->recovery Manager.9.click new10.selectTSL event->next->specify scenario name->next11.select the Tsl function(List_select_item)->error->E_Item_not_found->next.12.click define Recovery function.13.paste the script.
    • 14.click ok-> click ok-> click finish.15.save the script16 open a new script->rightclick paste ->file->test properties->Test typeas Compiled module.17.save the test18.load(scriptname)19.run the testWatch List:It enables you to monitor the values of variables, expressions, and arrayswhile you debug a test script.a=create_input_dialog(“Enter a Number”);b= create_input_dialog(“Enter a Number”);c=a*b;d=c*b;e=d*c;f=e*d;report_msg(g);Watch list Expression: g=a+b+c+d+e+fVirtual Object:Tool Might recognise a standard application as a bitmap object.Hence byusing virtual object we can instruct the tool. To Handle the applicationhas a standard application.Batch Test: It is used to execute Multiple Test in a single Batch Test. Call “script1”(); Call “script2”(); Call “script3”();