Winrunner Quest1
Winrunner Quest1
Winrunner Quest1
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
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.
Ans. WR can be used for functional testing for both the Desktop and Web based
applications.
Ans. WinRunner is suitable for any type of application whether it is a desktop application,
web application or a client server application.
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.
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
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.
19. What are all the different languages that can be called using TSL in
between the scripts?
Ans. Mostly C language
• GUI Checkpoint
• Bitmap Checkpoint
• Database Checkpoint
• Text checkpoints
28.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.
#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");
30. 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..
Ans. TSL is WR scripting language, TSL is based on C language style, TSL has a set of
different functions.
44. Big + of Winrunner over other market tools viz. silk, robot etc.?
47.How will you synchronize tests using WR? When should you synchronize?
Synch.settings?
Ans. A synchronization point tells Winrunner to pause the test run in order to wait for a
specified response in the application.
52.What are data driven tests & How Do you create it in WR?
Ans. Testing the same set of functionality using WinRunner with different inputs is called
Data Driven Testing. Data Driven test can be done through Wizard or manually writing the
TSL script. Data driven is available in Tool menu.
64. 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;
}
65. 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);
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.
72.What string of characters, when inserted into a string , will create a new
line in a message displayed by a pause statement.
Ans.
73.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).
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.
76.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.
ORANGE IT SOLUTIONS
_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
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.
81. What is location and Index.How WR will identify the same gui objects in a
window.
82. Can we change the phy desc of a gui object in GUI MAP EDITOR through script.
83. What is the WR testing process.
Ans.There are total 6 steps
1.Create Gui map
2.Create Test
3.Debug Test
4.Run Test
5.View Results
6.Report Defects