Está en la página 1de 9

Content

1. Automation
2. GUIMAP - how manage, what if script runs fine on one machine but not another?
3. Code organization, frequently used commands?
4. Test Director – database?
5. Source control?
6. How use/test GUI checkpoints and dynamicly changing items?
7. Database checkpoints?
8. Synchronization?
9. Data driven tests?
10. How handle unexpected events or errors?
11. Regular expressions?
12. Use of external libraries?
13. Java and web test addins? It will be very helpful.

Questions

1. Give one line answer about WR?

Ans. WinRunner helps you automate the testing process, from test development to
execution. You can create adaptable and reusable test scripts that challenge the
functionality of your application. Prior to a software release, you can run these
tests in a single overnight run—enabling you to detect defects and ensure
superior software quality.

2. How do you define WR on your own?

Ans.

3. WR is suitable for which type of applications?

Ans. WinRunner is suitable for any type of application whether it is a desktop application,
web application or a client server application.

4. What kind of applications WR suits?


Ans. Visual Basic, Power Builder, Active-X, Java and Web Applications

5. What are all the different types of recordings available in WR?


Ans. WinRunner has 2 types of recording modes namely
a. Context Sensitive Recording mode : identifies the GUI objects with their logical
names
b. Analog Recording Mode : identifies the GUI objects based on the screen
coordinates

6. When do you go for Context Sensitive and Analog? What's the difference
between them?
Ans. Analog is opted when we perform GUI Testing and Context sensitive for Functionality
testing.

7. What's the WR version no you used for your applications?


Ans. I have been working with WinRunner Version Number 7.0.
8. What is Module? What's Compiled Module?
Ans. Compiled modules are libraries of frequently-used functions. You can save user defined
functions in compiled modules and then call the functions from your test scripts.
A compiled module is a script containing a library of user-defined functions that you want to
call frequently from other tests. When you load a compiled module,
its functions are automatically compiled and remain in memory. You can call them directly
from within any test.
A module is a separable part of the system which can be executed individually.

9. What are User Defined Functions? What are all the different types of Functions
available in WR? What is Function? Types of Functions?
Ans. The Functions which are written by the user to accomplish a specific functionality of
his requirement are called user defined functions. The user defined functions are stored in a
compiled module so that any test can use this function after loading the compiled module.
The different types of functions in WinRunner are
a. Context Sensitive Functions
b. Analog Functions
c. Standard Functions
d. Custom Functions

10.Where do you use Private/Public function in your script?


Ans. A private function defined in a script can be used/called from only that script where
as a public function can be used/called from any script.

11.How do you forcibly capture an Object using WR (when WR not able identify
it)?
Ans. GUI Map Configuration

12.How TSL looks like? What are all the default files does WR generate when you
create a script?
Ans. TSL looks like c language. In fact its c only. The files/folders that are generated by
WinRunner when a script is created is db, exp and res.

13.How do you invoke an application using TSL?


Ans. Using Invoke_application function.

14.What's the use of GUI Map Editor?


Ans. GUI Map Editor is used to record the objects in the Current Window of your
application.

15.What's Data Driven Test?


Ans. Testing the same set of functionality using WinRunner with different inputs is called
Data Driven Testing.

16.What's the File Format used in Data Table?


Ans. The File Format used for Data Table in Data Driven Testing in WinRunner is Microsoft
Excel.

17.How do you link a Data Table in your script?


Ans. Using the ddt_open function in TSL we will be linking to the data table from our
script.
18. What are all the different languages that can be called using TSL in between
the scripts?
Ans.

19.What are all the Limitations & Advantages of WR?


Ans. Refer ReadMe document

20.Where do you find that WR cannot be used for automation?


Ans. Automation is not preferred if the project size is small, manual intervention is
necessary.

21.What is meant by Synchronization? How do you implement it in WR?


Ans. A synchronization point in your test script instructs WinRunner to
suspend running the test until the application being tested is ready, and then to
continue the test.

22.What is meant by Checkpoints? Types of Checkpoints? In what situation will


you use it?
Ans. Checkpoints allow you to compare the current behavior of the application being
tested to its behavior in an earlier version. Various check points are

• GUI Checkpoint
• Bitmap Checkpoint
• Database Checkpoint
• Text checkpoints

23.How do you handle an Exception in WR? Types of Exception available in WR?


Ans. Exceptions in WinRunner are handled using the Exceptional Handling Concepts. And
the different types of exceptions available in WinRunner are as follows:
• Pop-up exceptions: Instruct WinRunner to detect and handle the appearance of a
specific window.
• TSL exceptions: Instruct WinRunner to detect and handle TSL functions that return
a specific error code.
• Object exceptions: Instruct WinRunner to detect and handle a change in a property
for a specific GUI object.
• Web exceptions: When the Web Test add-in is loaded, you can instruct WinRunner
to handle unexpected events and errors that occur in your Web site during a test
run.

24.How do you define an Exception for complete application or for a particular


function?
Ans. We first define a TSL Function and then write a handler function in the compiled
module for that exception and load that particular compiled module in the script in which
you want to handle the exception through out the application…mostly in the main script.

25.What are all the different platforms that WR can be used?


Ans. WinRunner can be used only on Windows Platforms namely Windows 95, Windows
98, Windows NT, Windows 2000 and XP(wr ver 7.5).

26.What does GUI Spy mean?


Ans. GUI Spy is used to identify the properties of an object on the desktop.
You can use the Spy pointer to point to an object, and the GUI Spy displays the properties
and their values in the GUI Spy dialog box. You can choose to view all the properties
of an object, or only the selected set of properties that WinRunner learns.

27. Can you test DB using WR? What are all the different DB Checkpoints that WR
can support?
Ans. Yes we can check the database using WinRunner. There are all together 3 types of
database checkpoints in WinRunner namely Default Database Checkpoint, Custom Database
Checkpoint, and Runtime Database Checkpoint.

28.How do you set a Query to get/fetch data from the DB?


Ans. We can do that in two ways one is using the wizard and another is writing the script
manually in winrunner.
The second method is as follows:

#db_connect("Test","DSN=test");
if (db_connect("Test","DRIVER=SQL Server;SERVER=Rani;UID=sa;APP=Microsoft
Development
Environment;WSID=RANI;DATABASE=BugTracker;LANGUAGE=us_english;User
Id=sa;PASSWORD=;")==E_OK)
{
query="SELECT UserID, UserName, TeamName, PhoneExt,LoginName, Password FROM
UserDetails";
#db_check("list1.cdl", "dbvf1");
db_execute_query("Test",query,recordnum);
report_msg("The no of records returned is "&recordnum);
db_write_records("Test","c:\query.txt",TRUE);
db_disconnect("Test");
}
else
report_msg("Not Connected");

29. Apart from Record and Replay what else can be done using WR?
Ans. store and replay, customization based on user requirements, integration with test
management tools like test director, etc..

30.What are different types of Test Run Modes?


Ans. Verify/Debug/Update Modes

31.When do you use Verify/Debug/Update Modes?


Ans.
• Verify mode, to check your application. WinRunner compares the current
response of your application to its expected response. Any discrepancies
between the current and expected responses are captured and saved as
verification results. When you finish running a test, by default the Test Results
window opens for you to view the verification results.
• Debug mode, to debug your test script. Running a test in Debug mode is the
same as running a test in Verify mode, except that debug results are always
saved in the debug folder. Because only one set of debug results is stored, the
Run Test dialog box does not open automatically when you run a test in Debug
mode. Once you run a test in Debug mode, that remains the default run mode
for the current WinRunner session until you activate another mode.

• Update mode, to update the expected results or to create a new expected


results folder. For example, you could update the expected results for a GUI
checkpoint that checks a push button, in the event that the push button default
status changes from enabled to disabled. You may want to create an additional
set of expected results. After a test has run in Update mode or been aborted,
Verify automatically becomes the default run mode again. WinRunner saves
expected results in the exp folder, overwriting any existing expected results.

32. When do you use Break Points ?


Ans. A breakpoint marks a place in the test script where you want to pause a test run.
Breakpoints help to identify flaws in a script.

33.What's the role of GUI Map Editor?


Ans. Its connects logical name in the script to the physical attributes of the object in the
GUI Map

34.What does Function Generator mean? (F7).


Ans. Function Generator is the repository with system defined functions and also we can
organize user-defined functions.

35. How do you load GUI Map?


Ans. using the GUI_load function or from the GUI Map Editor

36. What is TSL? Which 4GL is it similar too?


37. What databases can Test Director reside on?
38. Name a couple of standard web function found in the function generator? And
explain their purpose.
Ans. Web_browser_invoke, web_image_click, web_obj_click,web_refresh,web_label_click,
Web_link_click, web_sync, web_url_valid

39. Explain data parameterization in WinRunner.(Refer UserGuide PgNo. 769)


40. Explain the project tree in Test Director.
41.What's the purpose of the wrun.ini?
Ans. Stores the configuration related to winrunner’s editor

42.What are the two GUI Map modes available in WR?


Ans. The two modes of having a GUI Map file are :
GUI Map file per test mode : A new GUI Map file will be created for each script
Global GUI Map: A Single GUI Map file is used for all the scripts.

43. Big + of Winrunner over other market tools viz. silk, robot etc.?

44. How does Winrunner identify GUI Objects?


45. What is the use of rapid test script wizard?
46. How will you synchronize tests using WR? When should you synchronize? Synch.
settings?
47. How do you check GUI objects?
48. How do you check a bitmap?
49. How do you program tests with TSL?
50. How do you run tests on a new version of WR?
51. What are data driven tests & How Do you create it in WR?
52. How do you read text from an application?
53. What is a batch test? How do you program a batch test?
54. What happens when user interface changes?
55. Does load testing possible using WR?
56. Does WR help you in web testing?
57. How do you manage test data, test result?
58. Any knowledge of Test Director?
59. Questions on TSL: How to generate Functions?
60. Running tests from the command line?
Ans.
61.Last question (most imp.): Explain Winrunner Testing Modes?
Ans. Context Sensitive mode : which identifies the GUI objects with their logical names
Analog Mode identifies the objects with the screen coordinates
62.Write a function to retrieve the script name?
Ans. call_chain_get_attr (“testname", 0, testnameX); or
getvar("testname");

63. Can we read and assign the content of a text file to a variable.
Ans.
file_open(file_name);
str = "";
line="";

while(file_getline(file_name,line)==0)
{
str = str & line;
}

64. How to clear the contents of a text file using WinRunner command?
Ans. Open the file with Write mode file_open (filename,FO_MODE_WRITE);

65. How to find a item is present in a list or not?


Ans.
if (list_get_item_number("ListName", "ItemName", number) != E_OK)
{
report_msg("Not in list");
}
else
{
report_msg("Item is number " & number & " in list");
}

66. What are the scripts we can include in start up of WinRunner?


Ans.

You should add the following types of statements to your startup test:
• Load statements, which load compiled modules containing user-defined
functions that you frequently call from your test scripts.
• GUI_load statements, which load one or more GUI map files. This ensures
that WinRunner recognizes the GUI objects in your application when you run
tests.
• Statements that configure how WinRunner records GUI objects in your
application, such as set_record_attr or set_class_map.
• an invoke_application statement, which starts the application being tested.
• Statements that enable WinRunner to generate custom record TSL functions
when you perform operations on custom objects, such as
add_cust_record_class.

67. How to round a number


Ans.
public function round (num, place)
{
return sprintf ("%."place"f", num);
}

68.What is the difference between tl_return and tl_exit


Ans.
tl_return is used at the end of a called test.

tl_exit is used at the end of normal test.

69.How to get focused html frame name?


Ans.
if (win_exists("{MSW_class: html_frame, focused: 1}",1) == E_OK)
{
win_get_info("{MSW_class: html_frame, focused: 1}","html_name",name);
pause(name);
}

70.How to find whether the given sub string is present in a string.


y = "ABCD ABCD XXXX";
z = index(y,"XXXX");
if (z == 0)
{
pause("No such string is found");
}
else
{
pause("String is found at position " & z);
}

71. What string of characters, when inserted into a string , will create a new line in a
message displayed by a pause statement.

72. letters["a"] = "A";


letters["b"] = "B";
letters["c"] = "C";
How to write TSL statement that loops thro the array and displays the contents.
NOTE: You can't initialize another array.

Ans.
72.How to use the ‘in’ operator in an Array?
Ans. in checks if the index is set for the array, not the assigned value of that array
element. Thus if I have this array:
myArray[0] = "zero";
myArray[1] = "one";
myArray[2] = "two";
myArray[99] = "last one";

(0 in myArray) will return true, (5 in myArray) will return false (nothing yet assigned to
myArray[5]). ("zero" in myArray) will return false (it's a value, not an index).

73.What is the difference between tl_step and report_msg?

Ans. tl_step will divide the script into sections and inserts a status message in the test
report for the previous section. In tl_step we can set whether the action is passed or failed.

Report_msg is used to write a message in the test results.

74.What is the difference between win_activate and set_window functions?


Ans. win_activate method activates the window. Set_window specifies the window to
receive subsequent input and (optionally) specifies the amount of time to wait for the
specified window.

75.Without adding an object to the guimap file, can we execute the script on a
particular object??
Ans. Yes. We can execute the script on a particular object without adding it to the gui map
file by giving the physical description of the object directly in place of the logical name.

76. What is the difference between the set_window and _set_window functions?
Ans. The set_window specifies the window to receive the subsequent input and optionally
specifies the amount of time to wait for the specified window. The parameter given for
specifying the window is the windows logical name.
_set_window specifies a window to receive input. Here the window’s physical description is
given to identify the window.
I think you know the difference between logical name and Physical description of a object.
set_window is used by giving logical name and you can give physical description.
But _set_window needs only physical description.
_set_window does not change the active window in the gui map.
set_window(window1);
_set_window(window2);

this will set window1 as the active "application window" and the active "gui window". When
you _set_window on window2, the "application window" is shifted to the physical description
of window2, but the gui map still "thinks" you are looking at window1.

This can be useful if you have a lot of windows with similar child objects (edit boxes, radio
buttons, etc). This can allow you to make a single GUI map entry for multiple windows.
Likewise, you can shift the focus of the active GUI map window without shifting the
currently active "application window" like this:
set_window(window1);
GUI_set_window(window2);
77. Is there any need for the GUI Map while working with Analog mode?

Ans. No. There is no need for the GUI Map file when we are working with analog mode

78.What is Silent Mode in WinRunner?


Ans. In silent mode, WinRunner suppresses messages during a test run so that a test can
run unattended. When you run a test remotely from TestDirector, you must run it in silent
mode, because no one is monitoring the computer where the test is running to view the
messages.

79. What are the modes in which you can organize your GUI Map files?
Ans. We can organize the GUI Map files in any of the below two modes:

• In the GUI Map File per Test mode, WinRunner automatically creates a new GUI
map file for every new test you create.

• In the Global GUI Map File mode, you can use a single GUI map for a group of
tests.

80.Can we insert Checkpoints in Compiled Module?


Ans. No We cannot insert any checkpoints in compiled module.
As per WinRunner’s User Guide “The content of a compiled module differs from that of an
ordinary test: it cannot include checkpoints or any analog input such as mouse tracking. The
purpose of a compiled module is not to perform a test, but to store functions you use most
frequently so that they can be quickly and conveniently accessed from other tests.”

81. Can we insert Checkpoints in a Analog Test Script?


Ans.

82. Can we store analog test script in Compiled Module?


Ans. No we cannot have analog test script in compiled modules.
As per WinRunner’s User Guide “The content of a compiled module differs from that of an
ordinary test: it cannot include checkpoints or any analog input such as mouse tracking. The
purpose of a compiled module is not to perform a test, but to store functions you use most
frequently so that they can be quickly and conveniently accessed from other tests.”

83. What is the difference between getenv() and getvar()?


Ans. The getenv() returns the value of an environmental variable defined in wrun.ini file
and getvar() returns the value of a testing option.

84. What are custom objects?


Ans. A custom object is any GUI object not belonging to one of the standard classes
used by WinRunner. WinRunner learns such objects under the generic “object”
class. WinRunner records operations on custom objects using obj_mouse_
statements.

También podría gustarte