Your Ad Here

28 May 2008

ABAB BDC Interview Questions

BDC

1

What should be the approach for writing a BDC program?

Ans.: 1. Analysis the Data. 2. Generate SAP structure. 3. Develop transfer program 4. Create sequential file. 5. Create batch input program. 6. Process batch input data

2

What is the alternative to batch input session?

Ans. : Call transaction & call dialog

What are the steps in a BDC session ?

The first step in a BDC session is to identify the screens of the transaction that the program will process. Next step is to write a program to build the BDC table that will be used to submit the data to SAP. The final step is to submit the BDC table to the system in the batch mode or as a single transaction by the CALL TRANSACTION command.

3

What are the problems in processing batch input sessions? How is batch input process different from processing on line?

Ans.: Sessions cannot be run in parallel and not fast.

4

What do you do when the system crashes in the middle of a BDC batch session?

-Check no. of records already updated and delete them from input file and run BDC again.

5

What do you do with errors in BDC batch session?

-Analysis and correct input file format and entries in internal table BDCDATA.

6

WHAT are the commands that allow you to process sequential file? And what is their syntax?

Ans :-

· READ DATASET (reading) and TRANSFER (writing)

· OPEN DTASET for in mode at POSITION MESSAGE

· READ DATASET INTO

· CLOSE DATASET

· DELETE DATASET

TRANSFER to

7

What is the process for transferring data from legacy system to SAP?
Ans :- FTP file transfer, Manufacturer –specific field transfer NFS(network file system)/BDC.

8

Explain the process to transfer a record to a dataset?

Ans :- TRANSFER to .

9

Why batch input?

Ans :- To input a large amount of information at off peak times.

10

Can data be put directly into the database?

Ans :- No, only after the data has been entered via transaction.

11

Explain at high level, the batch input process?

Ans :- Batch data is placed into queues called batch input sessions , then placed into the application programs for maintenance into the database.

12

What are the function modules associated with batch input?

Ans :- BDC_OPEN_GROUP , BDC_CLOSE_GROUP , BDC_INSERT

13

What is the structure of the BDC table?

Ans :- Program/Dynpro/start/field name/ field content.

14

Write out a coding example for filling a BDC Table.

Ans :-

FORM

REFEESH

CLEAR

MOVE to -PROGRAM

TO -DYNPRO

‘X’ TO -DYNBEGIN

APPEND

CLEAR

MOVE: TO -FNAM

TO -FVAL

APPEND

15

How do you find the transaction number, program number and field names?

Ans :-

· Transaction no.,program no. – System -> status

Field names - F1, Technical help

16

What are the processing modes for Batch Input?

Ans :- Process on screen(foreground) , Display errors only and process in the background

17

What are the available OK Codes that can be utilized during batch input processing?

Ans :-

· /n – terminates current batch input transaction and marks as incorrect.

· /bdel – delete current batch input transaction from session.

· /bend – terminate batch input processing and mark session as incorrect.

· /bda – change display mode to process the session on screen instead of displaying only errors.

/bde – change display mode to display only errors instead of processing the session on the screen.

18

What is the effect of the BDC_CURSOR field name in the BDC table?

Ans :- You can set the cursor and enter as a corresponding field value the name of the field on which the cursor is to be positioned .

19

How many types of BDCs you have done?

21

Why you choose Call transaction and/or session method?

Call transaction is mainly used when you want to update the database using a single transaction , you can also update the database in asynchronous mode, where as session is used to perform huge database updations using more than one transaction and which will last for a long time.

22

How you trap errors in call Transaction

Errors while updating the database using call transaction technique are trapped using a structure bdcmsgcall, whose field msgtyp become ‘e’ when an error record is encountered. Those records are formatted using format_message function call in the desired format and stored in an internal table for listing of all error records in one shot.

23

What are different types of Update modes

In BDC’s we have two types of updation modes – 1) Synchronous 2) Asynchronous

24

What is main difference between session method and LSMW

In the context of session method,

the method of updating is “Batch Input” ,

we require a program to be coded,

But in the context of LSMW method,

The methods of updating

using “Batch Input/Direction Input”

from an IDOC,

from a BAPI structure.

No source code is required, the complete operation is performed in 16 steps sequence

25

What is main difference between CATT and LSMW

Using LSMW you can update any kind of data but no changes to database are allowed, where as CATT tool can update only master data, which also allows changes to the master data and also a significant testing of data is possible

26

What is BDC and How you use it?

BC Basis Components--ABAP workbench--BC Basis Programming interfaces--Data transfer

During data transfer, data is transferred from an external system into the SAP R/3 System. •Transfer data from an external system into an R/3 System as it is installed. •Transfer data regularly from an external system into an R/3 System.

Example: If data for some departments in your company is input using a system other than the R/3 System, you can still integrate this data in the R/3 System. To do this, you export the data from the external system and use a data transfer method to import it into the R/3 System.

Batch input with batch input sessions : Data consistency check with the help of screen logic.

With the batch input method, an ABAP program reads the external data that is to be entered in the R/3 System and stores the data in a "batch input session". The session records the actions that are required to transfer data into the system using normal SAP transactions.

When the program has generated the session, you can run the session to execute the SAP transactions in it. You can explicitly start and monitor a session with the batch input management function (by choosing System ® Services ® Batch input), or have the session run in the background processing system.

Use the BDC_OPEN_GROUP function module to create a new session. Once you have created a session, then you can insert batch input data into it with BDC_INSERT. Use the BDC_INSERT function module to add a transaction to a batch input session. Use the BDC_CLOSE_GROUP function module to close a session after you have inserted all of your batch input data into it.

What is Dataset and how you use it?

ABAP/4 provides three statements for handling files:

The OPEN DATASET statement opens a file.

SAP ABAB Interview Questions

What is sap script and layout set?

Ans - SAPscript is the integrated text management system of the SAP R/3 System. SAPscript is tightly integrated into the SAP System. It is used for many different word-processing tasks all over the SAP System.



What is layout set?

A layout set in SAPscript is used for page layout. The layout set contains various elements, which are used for layout control of the individual pages and also contain layout information for texts which are to be output on the individual pages.

The layot of a document is defined in a layot set.

A layout set specified the appearance and structure of a document.

Layout sets contain predefined text modules with space reserved for variable data. You can use these text modules for different application.

Every SAPscript document uses a layout set.

To make changes to your documents, such as moving a piece of text, or changing fonts, paragraph formats, and tabs, you only need to change the layout set.

There are two ways of formatting texts using layout sets:

The text is entered and output in standard text maintenance. You can assign any layout set. Text can also be entered via the layout set a letter header, for example.

The text is formatted via an ABAP/4 program using a layout set. The program can either dynamically output individual predefined text modules, text elements or transfer entire texts, which are to be output in the layout set.

You can use Styles to define the formatting of the text in your documents. A style

determines text formatting by setting the paragraph and character formats used in a

document. You can, for example, use a style to highlight character strings or whole

paragraphs. You can assign a style to any text. Typically, however, you’ll use styles

primarily in the main windows of layout sets, where users type or enter text directly

in documents.

Header data is found in both style and layout set maintenance.

In style maintenance, it is used primarily to present important information - designed to make it easier for the end user to select a style. The header data in layout set maintenance, on the other hand, is used for information and control purposes.

Windows are defined in layout set maintenance. They represent areas

which are positioned on pages as page windows and in which text is

later output. At least one window must be defined for each layout set. If

not, a text cannot be formatted by SAP script.

The following window types can be used:

MAIN – Main window in which continuous text is output. This is the window used by dialog users of a print program and layout set. For example the body text of a letter would be entered in MAIN.

VAR – Window with variable contents. The text can vary on each page in which the window is positioned. Variable windows are formatted for each page.

CONST – Window with constant contents which is only formatted once.

A layout set has the following elements:

Header data - Data related to development (created by, development class, etc.) and layout set information (which elements are used) are both stored in the header data. A start page must be entered here.

Paragraph formats - Paragraph formats are required in layout sets - as in styles - in order to format texts. However, they are also used for word processing in layout sets, for example, to format text elements.

Character formats - You can also use character formats to format texts or paragraphs. Unlike paragraph formats, however, they are used to format text within a paragraph.

Windows - Windows are names and window types, which are not physically positioned until they are allocated to pages and units of measurement are specified.

Pages - Pages are defined to provide the system with a start and end point in text formatting.

Page windows - Page windows are the combination of windows and pages, where the dimensions of a window and its position on a page are specified.

The purpose of SAP script control commands is to allow control of the

output formatting. These commands are not interpreted by the SAPscript

editor, but are passed through to the SAPscript Composer for processing. The

composer is the program that converts text from the form displayed in the editor to

the form used for printing.

What is SAPscript and explain its purpose?

SAP Script is the SAP system’s own text-proessing system. You’ll find that it looks and feels a lot like other leading text-processing system that you may use on your personal computer.

Every company needs to output documents with a uniformly defined layout (eg. Invoices, delivery notes, etc..) all the time.

The basic layout of the document is pre-defined , but in many cases, other data has to be merged with it, such as address data or purchase order items. This data might be entered manually by a employee, or retrieved from a database table.

Large quantities of these documents have to be produced. From printing is usually a mattter of large print runs of documents such as payslips, checks, order confirmation, reminders etc.

SAPscript has been developed to meet the above requirements. IT is an integrated tool for text entry and form printing in R/3 applications.

These documents are normally provided by SAP but every organization have their unique waqys of these documents so to customize these and for creating newer ones if required; SAP script is used.

What are components of SAPscript?

Layout set, SAPscript Text, ABAP Print program , symbols, function modules like open_form, close_From, Read_text etc,.

What are the ABAP/4 Commands that link to a layout set?

Call function OPEN-form.

Call function WRITE-from.

Call function CLOSE-from

Importing Graphics (Logos) into SAPScript

The program RSTXLDMC can be used to upload graphics (file extension .tif on PC files) into individual standard text.

Other useful programs for SAPScript

RSTXFCON - Converts page format

RSTXSCRP - Upload/Download layout sets

RSTXDBUG - SAPScript debugger

Debug SAPScript

You can debug a SAPScript: Use Tools - Word Processing - Layout Set.

Enter name of layout set and then Utilities - Activate Debugger.

It is of no consequence which layout set you enter when selecting the SAPscript debugger. (Menu path: Tools-Word-processing - Forms, Utilities - Activate Debugger) The next layoutset called will invoke the debugger. This is quite handy when verifying which layoutset is being called (Verifying customizing settings).

Another way to set the SAPScript debugger is to run program RSTXDBUG.

When a Form is copied from one client to another .And If U try to display or change the form in the copied client .The possible error message cud be :

1.Form not found

Try coping again specifing the language .

2.IF IT dispalys an error message saying That the text file is inconsistent .

Then go to SE38 and Run “RSTXCHKO” .

It will ask for the form name ,then check all the checkboxes and then run the program.

Note : all Script related problems can be solved using Program ‘RSTX*’.

How to take a back up of script layout into U’r hard disk and load it later

Use Program RSTXSCRP.

Use EXPORT mode, when downloading and IMPORT when uploading a script. Don’t forget to give the form name in the object field. This will create a script with the same name as that of the original script . If a script with the same name exists in the same client ,then it will give an error ‘Object cannot be overwritten ’ .

I want to copy table across clients

Use Program RSCLTCOP

To transfer script files across systems (Not Clients) - RSTXSCRP

To compare the contents of a table across clients: RSTBSERV

To change the development class of any object - RSWBO052

What type of variables normally used in sap script to output data?

&Tables name- fields&.

How do you number pages in sap script layout outputs?

& page &

&next Page &

What takes most time in SAP script programming?

Defining layout set up / sets.

How do you use tab sets in layout sets?

Define paragraph with defined tabs.

How do you backup sap script layout sets? Can you download and upload? How?

SAP script backup :- In transaction SE71 goto Utilities -> Copy from client -> Give source form name, source client (000 default), Target form name.

Download :- SE71, type form name -> Display -> Utilities -> form info -> List -> Save to PC file.

Upload :- Create form with page, window, pagewindow with the help of downloaded PC file. Text elements for Page windows to be copied from PC file.

What is Compare Tool in SAP Script ?

SAP Script offers tools for comparing objects across clients. We can compare or copy the following kinds of objects.

Styles

Layout sets

Documents

With the Compare tool we can do the following :

Check whether an object exists in both clients

Display the differences between the versions of an object

Layout Sets are used to control page layout and text formatting in documents .

SAP Standard styles and layout sets are always held in Client 000.

In what format does SAP Script store text ?

SAPscript texts are stored in Interchange Text Format (ITF). SAPscript offers conversion programs for the text file formats Rich Text Format (RTF) and ASCII as an interface to other word processors.

The various window types in SAP Script are

Main, Variable and Constant.

The New-Page command is used to force a Page break in the text at any point.

Protect ... Endprotect command pairs can be nested (True / False).

False.

Delimiter & must be used immediately before and after the symbol.

What does the composer do?

The final appearance of your documednt depends on interaction between the print program and the layout set.

The SAPscript print program initializes the printing process. Every command entered using the SAPscript programming interfaces is transferred to the composer.

The composer received layout information from the layout set specified by the print program. The documents are formatted according to this layout information.

If the documents contain variables, the compoer replaces these variables with data from the R/3 system, such as the current date, or with the userdata selected by the print program.

The print program controls the completion of thelayout set. Once this is done, the composer places the completed document in the spool.

Where do we define Tab space for data in SAPScript?

When defining the paragraph for the text element we can define the TABS then. There is parameter called TABS to be defined in paragraph definition.

what is difference between Window & a Page Window?

Window: An area that is predefined in the layout set. Windows are text modules, which are positioned on a document page.

We define the window type, Default Paragraph, specify the text elements or a SAPscript text to be included etc in the Windcow Component.

PageWindow: we define the parameters of the earlier defined Window, appearance on the document like left or right margins, Width & Height.

What are symboles & state their different types with E.g.

A Symbol is a constant, which can be inserted in a document. It saves the user unnecessary work when replacing sections of text, phrases, etc. Each symbol has a name which is encloses by &.

Eg. &variable name &

System symbols eg &Date&, &time& etc.

Standard symbols :Standard symbols are user-defined. They are maintained centrally in table TTDTG. Eg. &SGDH& for the opening salutation : “dear sir/madam”.

&MFG& for the closing saluta

Win Runner Interview 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. WR can be used for functional testing for both the Desktop and Web based applications.

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. What is the extension for the check points?
Ans. The extension for the checklist are .ckl

14. How do you invoke an application using TSL?
Ans. Using Invoke_application function.

15. 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.

16. What's Data Driven Test?
Ans. Testing the same set of functionality using WinRunner with different inputs is called Data Driven Testing.

17. 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.


18. 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.

19. What are all the different languages that can be called using TSL in between the scripts?
Ans. Mostly C language

20. What are all the Limitations & Advantages of WR?
Ans. You cannot install WinRunner 7.0 over network installations of previous versions of WinRunner.

Workaround: When performing a network installation of WinRunner, either remove installations of previous versions first, or install the new version in a different location.

Refer ReadMe document ….for more number of limitations

21. 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.

22. 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.


23. 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

24. 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.

25. 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.

26. 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).

27. 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.

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.

29. 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");

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..

31. What are different types of Test Run Modes?
Ans. Verify/Debug/Update Modes


32. 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.

33. 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.

34. 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

35. What does Function Generator mean? (F7).
Ans. Function Generator is the repository with system defined functions and also we can organize user-defined functions.

36. How do you load GUI Map?
from the GUI MapAns. using the GUI_load function or Editor

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

Ans. TSL is WR scripting language, TSL is based on C language style, TSL has a set of different functions.

38. What databases can Test Director reside on?

39. 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


40. Explain data parameterization in WinRunner.(Refer UserGuide PgNo. 769)
Ans. Parameterization means dynamically passing different values to the application under test.

41. Explain the project tree in Test Director.

42. What's the purpose of the wrun.ini?
Ans. Stores the configuration related to winrunner’s editor

43. 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.


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

45. How does Winrunner identify GUI Objects?
Ans. Winrunner will identify the GUI objects by its “Phy Desc” of particular object.

46. What is the use of rapid test script wizard?
Ans. The Rapid Test Script wizard systematically opens the windows in your application and learns the description of every GUI object. The wizard stores this information in a GUI map file.

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.

48. How do you check GUI objects?
Ans. We can check the GUI objects by GUI Check Points

49. How do you check a bitmap?
50. How do you program tests with TSL?
51. How do you run tests on a new version of WR?

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.

53. How do you read text from an application?

54. What is a batch test? How do you program a batch test?
Ans.Running a set of scripts through CALL method is called batch test.

55. What happens when user interface changes?
Ans. When user interface changes WinRunner cannot find the objects which are stored in GUI map editor. Then we need to modify the physical description in the Gui Map Editor.

56. Does load testing possible using WR?
Ans. Yes.

57. Does WR help you in web testing?
Ans. Yes , Winrunner will help in web testing.

58. How do you manage test data, test result?

59. Any knowledge of Test Director?


60. Questions on TSL: How to generate Functions?


61. Running tests from the command line?
Ans.
62. 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
63. Write a function to retrieve the script name?
Ans. call_chain_get_attr (“testname", 0, testnameX); or
getvar("testname");


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);

66. 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");
}

67. 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.

68. How to round a number
Ans.
public function round (num, place)
{
return sprintf ("%."place"f", num);
}

69. 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.


70. 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);
}


71. 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);
}


72. 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.
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).

74. 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.

75. 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.

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.
_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. What is treturn and texit.
Ans. Treturns, stops a called test and returns control to the calling test.
Texit, stops execution of the current test.

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

84. What is Runtime data base check point.

85. Ans.
86. What is Standard data base check point.
Ans. You can create the standard check points to compare the current values of the properties of the result set to the expected values captured during the record time or otherwise set before the test run.
In Standard database check points
1.Default checkpoint
2.Custom checkpoint (This checkpoints appears in your test script as a db_check statement)

87. What is Default data base checkpoint.
Ans.You this default checkpoint to check entire contents of a result set

88. What is Custom data base checkpoint.
Ans.Custom check points are used to check partial contents (i.e.) Number of rows, Number of columns of a result set.

The test script for the above to checkpoints appears as db_check("list1.cdl", "dbvf1");

where list1.cdl is the name of the checklist containing information about the database and the properties to check,

dbvf1 is the name of the expected results file.