Tricentis Tosca 16.0 Released on Feb-2023 ----- UFT has been upgraded from UFT 15.0.1 to UFT One 15.0.2, Beginning at November 2020.

Sunday 17 December 2017

SAP FICO Interview questions and Answers


1. Does any one know what is Software life cycle, it was a question asked in an interview.

Ans: it is nothing but Road Map - five phases  like, Project Preparation, Blue print, Realisation, Final preparation and Go-live support.


1.Whether any FI document will be created during PO(Purchase order)?If pl mention the entry also?

Ans: There is no document that is created in FI side during PO. But in controlling there can  be a commitment posting to a Cost Center. The offsetting entry is posted at the time of GR.

2.What factors differentiates from one dunning level and other dunning level

Ans: The most important thing that differentiates the dunning levels are the dunning texts. The dunning text defines the urgency of the dunning notice. The other things can be the dunning charges, minimum & maximum amounts etc.

3.APP There will be many banks in a house bank. If the payment should be maid from particular bank GL account. Where it is configured.

Ans: There can be several accounts in the same house bank. We should assign the GL accounts exclusively at the time of creating the Bank master data and the bank accounts. Accordingly we can do the bank determination in FBZP for the individual banks and the corresponding sub accounts.
Tr code for Defining bank : FI12.

4.What are various types of servers in SAP R/3?
Ans: The Typical SAP landscape looks something like figure 1.4 below:

5. Can anybody explain me FI-MM integartion.pl explain in detail 
i.   movement types
ii.  account class
iii. material types

i. Movement types:
Classification key indicating the type of material movement (for example, goods receipt, goods issue, physical stock transfer).
The movement type enables the system to find predefined posting rules determining how the accounts of the financial accounting system (stock and consumption accounts) are to be posted and how the stock fields in the material master record are to be updated.

ii. Valuation class
Assignment of a material to a group of G/L accounts
Along with other factors, the valuation class determines the G/L accounts that are updated as a result of a valuation-relevant transaction or event, such as a goods movement.
The valuation class makes it possible to:
- Post the stock values of materials of the same material type to different G/L accounts
- Post the stock values of materials of different material types to the same G/L account

iii. Transaction/Event Key
Key allowing the user to differentiate between the various transactions and events (such as physical inventory transactions and goods movements) that occur within the field of inventory management.
The transaction/event type controls the filing/storage of documents and the assignment of document numbers.

iv.  Material Type
Groups together materials with the same basic attributes, for example, raw materials, semifinished products, or finished products.
When creating a material master record, you must assign the material to a material type. The material type you choose determines:
- Whether the material is intended for a specific purpose, for example, as a configurable
  material or process material
- Whether the material number can be assigned internally or externally
- The number range from which the material number is drawn
- Which screens appear and in what sequence
- Which user department data you may enter
- What procurement type the material has; that is, whether it is manufactured in-house or
  procured externally, or both
Together with the plant, the material type determines the material's inventory management requirement, that is:
- Whether changes in quantity are updated in the material master record
- Whether changes in value are also updated in the stock accounts in financial accounting

6.Maximum no. of dunning levels are created?

Ans: 9 levels maximum.

7.In how many ways APP  is configured?
Tr Code: FBZP

8.What is diff between AAM,Recurring entries,Sample doccument?

Account Assignment Model:
A reference for document entry that provides default values for posting business transactions. An account assignment model can contain any number of G/L account items and can be changed or supplemented at any time. In contrast to sample documents, the G/L account items for account assignment models may be incomplete.

Recurring Entries:
A periodically recurring posting made by the recurring entry program on the basis of recurring entry original documents.
The procedure is comparable with a standing order by which banks are authorized to debit rent payments, payment contributions or loan repayments.

Sample Documents:
Special type of reference document. Data from this document is used to create default entries on the accounting document entry screen.
Unlike an accounting document, a sample document does not update transaction figures but merely serves as a data source for an accounting document.


9. Where to assign activity type in cost centers?  OR how to link cost centers & activity types?There is no direct assignment.  You plan the output for a cost center first in kp26.   Then you've to plan the value of that cost center which you budget for a period in kp06.   Planned Activity expenditure / Planned Actvty qty gives you planned act rate which you can use to valuate your activity confirmations in mfg ordrs.   You can also define your own prices,but you have to run the price revaluation if you want to revaluate your actual activity prices.


10. For stat. key figure what is the significance of sender & receiver cost elements & cost centers?
Stat key fig are not real account assignments.  In simple traditionl terms it is the base to allocate or define praportions with which the cost is allocated.  SKFs are used to calculate the debit on a receiver object.  These values can be used for assessing common costs which are used by all the other cost centers


11.  How SKF works .. Kindly give me T Codes Also.
You create & plan SKF.
Create using KK01 & PLAN the parameters of SKF in KP46


12.  In GL master we have a option "Balance in local currency" and "Account currency".What does it mean?

Ans: Account currency is that the GL account in which currency do you want to maintain. if you decided that you want maintain in company code currency, you can post any currency in that account.
If not, you want to maintain separate currency for that GL then exchange rate difference will come because the conversion rate.

Balance in local currency - some GL account can't be maintain on open item basis and can't in foreign currency like clearing account and discount account etc., in such case you can assign this indicator to show the balance in local currency.


Q. In movement type(MM), what is value & quantity string I know it updates values and quantities in GL with mix of valuvation class, transaction key modifier and GL A/c. But how does it work when doing a mvt type?

Ans: Basically, the system does not know which GL has to be updated with what. here, we are giving a direction to the system to update the data.
What you said is correct, the system will update the value and qty in the material master.  You would have seen some more fields also, like Movement indicator, consumption, value string and transaction event key etc.,
While creating a PO, the system will take the Movement type as a base, with MT, it will identify the MI(movement indicator - used to define whether it is goods movement for production order, purchase order, delivery note etc), and it will identify the consumption,( like it is assets, or consumption or sales order) and it will identify the value string ( it is must to assigned to movement type, through allocation of value string to movement type, system will automatically identify the GL ) and it will post the entry (dr/cr)in the GL based on the transaction and event key figure which is used to determine the debit and credit entry of a GL



Wednesday 29 November 2017

String Functions

Len Function-

Returns the number of characters  in a string or the number of bytes required to 
store a variable.

Syntax: Len(string | varname)

Arguments:
 string:  Any valid string expression. If string contains Null, Null is returned.
Varname:  Any valid variable name. If varname contains Null, Null is returned.

Example:
Str="Welcome to the World of QTP"
Print Len(Str) 
' Output --> 27

Print  Len("Good Morning") 
' Output--> 12

LCase Function-
Returns a string that has been converted to lowercase.

Syntax: LCase(string)

Arguments:
 String:  Any valid string expression. If string contains Null, Null is returned.

Example:
Str="Welcome to the World of QTP"
Print LCase(Str)
'Output --> welcome to the world of qtp

Print  Lcase("Good Morning")
'Output --> good morning

UCase Function-

Returns a string that has been converted to uppercase.

Syntax: UCase(string)

Arguments:
String:  Any valid string expression. If string contains Null, Null is returned.

Example:
Str="Welcome to the World of QTP"
Print Ucase(Str)
'Output --> WELCOME TO THE WORLD OF QTP

Print  Ucase("Good Morning")
'Output --> GOOD MORNING

Left Function-
Returns a specified number of characters from the left side of a string.

Syntax: Left(string, length)

Arguments:
String:  String expression from which the leftmost characters are returned. 
If string contains Null, Null is returned.
length:  Numeric expression indicating how many characters to return. If 0, 
a zero-length string("") is returned. If greater than or equal to the number of 
characters in string, the entire string is returned.

Example:
Str="Welcome to the World of QTP"
print  Left(Str,3)
'Output --> Wel

Print Left("Good Morning",4)
'Output --> Good

Right Function-
Returns a specified number of characters from the right side of a string.

Syntax: Right(string, length)

Arguments:
String:  String expression from which the rightmost characters are returned.
If string contains Null, Null is returned.
length: Numeric expression indicating how many characters to return. If 0, 
a zero-length string is returned. If greater than or equal  to the number of characters 
in string, the entire string is returned.

Example:
Str="Welcome to the World of QTP"
print  Right(Str,12)
'Output --> World of QTP

Print Right("Good Morning",7)
'Output -->  Morning

Mid Function-
Returns a specified number of characters from a string.

Syntax: Mid(string, start[, length])

Arguments:
String:  String expression from which characters are returned.If string contains Null.
Null is returned.
Start: Character position in string at which the part to be taken begins. If start is greater 
than the number of characters in string, Mid returns a zero-length string ("").
length: Number of characters to return. If omitted or if there are fewer than 
length characters in the text (including the character at start), 
all characters from the start position to the end of the string are returned.

Example:
Str="Welcome to the World of QTP"
print  Mid(Str,9,12)
'Output --> to the World

Print Mid("Good Morning",6,7)
'Output --> Morning

Print Mid("Good Morning",6)
'Output --> Morning

Replace Function-

Returns a string in which a specified substring has been replaced with another
substring a specified number of times.

 Syntax: Replace(expression, find, replacewith[, start[, count[, compare]]])

Arguments:

expression:  (Required) String expression containing substring to replace.
find: (Required) Substring being searched for.
replacewith: (Required) Replacement substring.
start: (Optional) Position within expression where substring search is to begin.If 
omitted, 1 is assumed. Must be used in conjunction with count.
count: (Optional) Number of substring substitutions to perform.If omitted, the default 
value is -1, which means make all possible substitutions. Must be used in conjunction 
with start.
compare: (Optional) Numeric value indicating the kind of comparison to use when 
evaluating substrings. See Settings section for values. If omitted, the default value is 0,
which means perform a binary comparison.

Example:
Str="Welcome to the World of QTP"
print Replace(Str, "to","into")                                                   
'Output -->     Welcome into the World of QTP

Print Replace("Good Morning","Morning","Night")               
'Output -->  Good Night

Print Replace("Quick Test ProfeSsional","s","x",5,3,0)           
'Output -->  k Text ProfeSxional

Print Replace("Quick Test ProfeSsional","s","x",5,3,1)                   
'Output -->    k Text Profexxional

Space Function-
Returns a string consisting of the specified number of spaces.

Syntax: Space(number)

Arguments:
number: number of spaces you want in the string.

Example:
Str="Welcome to the World of QTP"
'Space
Str1="Welcome"
Str2="to the World"
Str3="of QTP"

Print  Str1 & Space(2) & Str2 & Space(2) &Str3
'Output-->Welcome  to the World  of QTP

Split Function-
Returns a zero-based, one-dimensional array containing a specified number of 
substrings.

Syntax: Split(expression[, delimiter[, count[, compare]]])

Arguments:
expression: (Required) String expression containing substrings and delimiters. If 
expression is a zero-length string, Split returns an empty array, that is, an array 
with no elements and no data.
delimiter: (Optional) String character used to identify substring limits. If omitted,the 
space character (" ") is assumed to be the  delimiter. If delimiter is a zero-length string,
a single-element array containing the entire expression string is returned.
count:   (Optional) Number of substrings to be returned; -1 indicates that all 
substrings are returned.
compare: (Optional) Numeric value indicating the kind of comparison to use when 
evaluating substrings.

Example:
'Space as Delimiter
Str="Welcome to the World of QTP"
'Split
SArray=Split(Str," ",-1)
For  i= 0 to UBound(SArray)
    Print  SArray(i)
Next

'Comma As Delimitter
Str="Welcome,to,the,World,of,QTP"
'Split
SArray=Split(Str,",",-1)
For  i= 0 to UBound(SArray)
    Print  SArray(i)
Next

StrComp Function
StrComp: Returns a value indicating the result of a string comparison.
Syntax: StrComp(string1, string2[, compare])

 Arguments:

 string1: (Required) Any valid string expression.

string2: (Required) Any valid string expression.

compare:  (Optional) Numeric value indicating the kind of comparison to use when 
evaluating strings. If omitted, a binary comparison is performed.

 Example:

Str="Welcome to the World of QTP"
StrComp
Str1 = "QTP"
Str2 = "qtp"                                  
Print StrComp(Str1, Str2, 1)                          
'Output--> Returns 0 , which means Str1 is equal to Str2 for  textual comparison
Print StrComp(Str1, Str2, 0)                          
'Output--> Returns -1 , which means Str2 is  greater than  Str1 for  Binary comparison

Print StrComp(Str2, Str1)                              
'Output-->Returns 1, which means Str2 is  greater than  Str1 for  Binary comparison
Print StrComp(Str1, Str2)                                
'Output-->Returns -1, which means Str1 is  less than  Str2  for  Binary comparison
________________________________________

StrReverse Function
StrReverse: Returns a string in which the character order of a specified string
is reversed.

Syntax: StrReverse(string1)

Arguments:
 string1: string whose characters are to be reversed. If string1 is a zero-length 
string (""), a zero-length string is returned. If string1 is Null, an error occurs.

Example:

Str="Welcome to the World of QTP"
StrReverse
print  StrReverse(Str)                                
'Output-->PTQ fo dlroW eht ot emocleW

Print  StrReverse("Quick Test ProfeSsional")                 
'Output-->lanoisSeforP tseT kciuQ
________________________________________

LTrim; RTrim; and Trim Functions

LTrim,RTrim and Trim: Returns a copy of a string without leading spaces (LTrim), 
trailing spaces (RTrim), or both leading and trailing spaces (Trim).

Syntax:  LTrim(string)
RTrim(string)
Trim(string)

Arguments:
string:  The string argument is any valid string expression. If string contains Null, 
Null is returned.

Example:
'LTrim
Print Ltrim("Welcome to QTP World")            
 'Output-->"Welcome to QTP World

Example:
'RTrim 
Print Rtrim("Welcome to QTP World")                   
'Output--> "Welcome to QTP World"

Example:
'Trim
Print     trim("Welcome to QTP World")               
'Output-->"Welcome to QTP World"

InStr Function
InStr: Returns the position of the first occurrence of one string within another.

Syntax: InStr([start, ]string1, string2[, compare])

Arguments:

start:    (Optional) Numeric expression that sets the starting position for each search. 
If omitted, 
search begins at the first character position. If start contains Null, an error occurs. 
The start argument is required if compare is specified.

 string1: (Required) String expression being searched.

string2: (Required) String expression searched for.

compare: (Optional) Numeric value indicating the kind of comparison to use when 
evaluating substrings.

Example:

Str="How do you DO ?"
'InStr
Print Instr(1, Str, "DO", 1)               
'Output--> 5 , which means  it found the string in 5th position for  textual comparison

Print Instr(1, Str, "DO", 0)               
'Output--> 12 , which means  it found the string in 12th position for binary comparison

Print Instr(6, Str, "do", 0)                   
'Output--> 0 , which means  it  didnot found the string after the 6th position  for 
binary comparison

InStrRev Function
InStrRev: Returns the position of an occurrence of one string within another, 
from the end of string.

 Syntax: InStrRev(string1, string2[, start[, compare]])

 Arguments:

 string1: (Required) String expression being searched.

string2: (Required) String expression being searched for.

start:  (Optional) Numeric expression that sets the starting position for each search. 
If omitted, -1 is used, which means that the search begins at the last character position. 
If start contains Null, an error occurs.
compare: (Optional) Numeric value indicating the kind of comparison to use when
 evaluating substrings. If omitted, a binary comparison is performed. 

Example:
Str="How do you DO ?"

'InStrRev
Print InStrRev(Str,"DO",-1,1)               
'Output--> 12 , which means  it found the string in 12th position for  textual comparison
Print InStrRev(Str,"do",-1,0)           
'Output--> 5 , which means  it found the string in 5th position for binary comparison

Print InStrRev(Str,"DO",13,0)           
'Output--> 12 , which means  it found the string in  12th position for binary comparison

Print InStrRev(Str,"DO",10,1)           

'Output--> 5 , which means  it found the string in 5th position for  textual comparison 

Wednesday 26 July 2017

Write a code to print numbers from 5 to 0?

For i=5 To 0 step -1
WScript.Echo i
Next

In what way program "hello world" you can write in VBscript?

In VBscript, you can write hello world in two ways, the program will display a message box with text hello world.
  1. MsgBox "Hello World"
  2. Echo "Hello World"

Thursday 15 June 2017

Difference between .Vbs and .qfl in QTP..?

.Vbs and .qfl Both are function lib files.But if we save as .qfl then we can run it only using qtp. But .vbs are vb files, we can run them independently.


Tuesday 30 May 2017

How to search Emails received by today in your Inbox


Dim iTodayMails
iTodayMails = 0

'Open GMail
SystemUtil.Run "iexplore.exe""http://www.gmail.com"

'Page Sync
Browser("Gmail").Page("Gmail").Sync

'Login to Gmail
Browser("Gmail").Page("Gmail").WebEdit("UserName").Set "username"
Browser("Gmail_2").Page("Gmail_2").WebButton("Next").Click

Browser("Gmail").Page("Gmail").WebEdit("Password").Set "password"
Browser("Gmail_2").Page("Gmail").WebButton("Sign in").Click

'Page Sync
Browser("Inbox").Page("Inbox").Sync

'Search for emails received today in your inbox
'Logic - The mails received today will have only time in the last(8th) column.
'Time is always preceded by am or pm. So the code check for the last 2 characters and matches it with am or pm.

For iR = 1 to 50
        sLastColumnText = Browser("Inbox").Page("Inbox").Frame("Frame").WebTable("Emails").GetCellData(iR, 8)
        sLast2Characters = Right(sLastColumnText, 2)
        If sLast2Characters = "am" or sLast2Characters = "pm" Then
            iTodayMails = iTodayMails + 1
        Else
            'Exit For
        End If
Next

'Report the number of  mails received today
Reporter.ReportEvent micPass, "Total Emails Received Today - " & iTodayMails, ""

'Sign out from GMail
Browser("Inbox").Page("Inbox").Frame("Frame").Link("SignOut").Click
Browser("Gmail").Page("Gmail").Sync
'Close the browser
Browser("Gmail").Close()


Monday 29 May 2017


How to get the collection of all TD (table data cells) elements of the table using HTML DOM in QTP?


Set tdtags =Browser(“Browser”).Page(“Page”).WebTable("mytable").Object.getElementsByTagName("TD")


How to get the collection of all TH (table header cells) elements of the table using HTML DOM in QTP?


set thtags = Browser(“Browser”).Page(“Page”).WebTable("mytable").Object.getElementsByTagName("TH")


How to get the value of attribute of any element using HTML DOM in QTP?

Set myobj = Browser(“Browser”).Page(“Page”).WebTable("mytable").Object
Print myobj.getAttribute("class"'This will print the value of class attribute of myobj - table 


How to get the collection of all table rows using HTML DOM in QTP?

Set tableObj =Browser(“abc”).Page(“mypage”).WebTable("mytable").Object
Set trtags = tableObj.getElementsByTagName("tr")

How to find the total number of rows in table Using HTML DOM in QTP?


print trtags.length


How to get the value inside table cell Using HTML DOM in QTP?

Set tdtags =Browser(“abc”).Page(“mypage”).WebTable("mytable").Object.getElementsByTagName("TD")
Print tdtags(0).innerText 'print the text displayed inside first td tag in table


Thursday 25 May 2017

What is Optional step in QTP ? How you can add optional step in QTP?

 An optional step is a step that is not necessarily required to successfully complete a run session.
During a run session, if the object of an optional step does not exist in the application QTP  bypasses this step and continues to run the test
To set a step as optional in keyword view right click on the step and select Optional Step
Alternatively, you can directly write the keyword "OptionalStep" preceding a statement to make it optional

 Syntax

OptionalStep.StatementToMakeOptional

 Example

The following example uses the OptionalStep object to make the Paris selection from the Depart WebList an optional step.


OptionalStep.Browser("Mercury Tours").Page("Find Flights").
WebList("depart").Select "Paris"


Wednesday 24 May 2017

How to create an array of dictionary in UFT?

Dim ArrayofDictionary(2)
First element of array

Set ArrayofDictionary(0)= createobject("scripting.dictionary")
ArrayofDictionary(0).Add "key1""temp1"
ArrayofDictionary(0).Add "key2""temp2"
Added keys in first dictionary

Second element of array as dictionary
Set ArrayofDictionary(1)= createobject("scripting.dictionary")
ArrayofDictionary(1).Add "key1""temp1"
ArrayofDictionary(1).Add "key2""temp2"
Added keys in second dictionary…..and so on
x

Explain how you can fetch data from database in UFT?

Set db= createobject (“ADODB.Connection”)
db.Open “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:\guru99\vb6\admission_project.mdb;
Persist Security Info= False
Set rst=createobject(“ADODB.Recordset”)
rst.Open “select*from Course”, db, 3
id=rst. RecordCount
For i=0 to id-1
Print rst.field (0) & rst.fields (1) & rst.fields (2) & rst.fields (3)
rst.Movenext
Next

Sending mail from outlook using UFT

Set Outlook = CreateObject ("Outlook.Application")


Dim Message 'As Outlook.MailItem


Set Message = Outlook.CreateItem(olMailItem)


With Message
.Subject = Subject
.HTMLBody = TextBody
.Recipients.Add (aTo)
Const olOriginator = 0
.Send
End With

Tuesday 23 May 2017

Basic Automation Testing Questions and Answers

1) What is Automation?
General definition: Manual Process to mechanized process
Software Industry definition: Automation is a Microsoft technology that makes it possible to access software objects inside one application from other applications. These objects can be created and manipulated using a scripting or programming language such as VBScript or VC++. Automation enables you to control the functionality of an application programmatically.
2) What is Test Automation?
Automating Software Test process using Test Tools
3) What is Test Tool?
Test tool is software application it performs test operations based on user instructions.
4) What are the disadvantages of Manual Testing?
i) Huge Amount of Human Resources as well as Environment (Test lab)
ii) Time taking process
iii) Less Accuracy
iv) Tiredness
5) What are the advantages of Test Automation?
i) Fast: Tools are faster in execution than human users
ii) Reliable: Tools are reliable in complex calculations and tasks
iii) Reusable: we can reuse Automated Tests on multiple versions of Software (Ex: Sanity Tests, Regression Tests)
iv) Repeatable: we can repeat same operations with multiple sets of Test Data (Ex: Data driven Tests)
v) Programmable: we can use flow control statements for applying logic (Scope of Automated Tests is very high than Manual Test Cases)
vi) Comprehensive: we can execute series of Tests without human interaction (Ex: Batch Testing)
6) What are the drawbacks of Test Automation?
i) Test design requires lot of efforts
ii) 100% test automation impractical
iii) All types of testing not possible (Ex: Usability)
iv) Debugging issues
v) Tools may have their own defects
7) What is Vendor tool and give examples?
Companies develop tools, license is required to use and get technical support.
HP-WinRunner, QTP, LR, QC
IBM-Rational- Rational Robot, RFT, RPT, QA Director
Micro-SilkTest, Silk Performer
8) What is Open source Tool and give example?
Source code available on Internet anybody can download and use.
Ex: Selenium, Jmeter, Bugzilla, QAwebload etc…
9) What is In-house tool?
Some companies develop tools for their internal use.
Microsoft, Oracle Corporation and IBM developed so many tools for their internal use.
10) Give some examples for Functional & Regression Test Tools?
HP- QuickTest Professional (QTP)
IBM- Rational Functional Tester (RFT)
Micro Focus- Silk Test
Test Complete
Test Partner
Selenium (Open Source)
11) Give some examples for Performance Test Tools?
HP-LoadRunner
IBM-Rational Performance Tester (RPT)
Micro Focus- Silk Performer
JMeter (Open Source)
Etc..
12) Give some examples for Test management Tools?
HP- Quality Center / ALM
Jira
Rational QA Director
Etc..
13) Give some examples for Defect Management Tools?
Bugzilla,
Issue-Tracker,
PR-Tracker
Etc…
14) What is the deference between Automation tools and Management tools?
Automation tools interact with software applications, Test management tools don’t interact with software applications.
Test management tools only for documentation and generation reports where as Automation tools execute our software applications.
15)What is Functional Testing?
Testing based on an analysis of the specification of the functionality of a component or system.
16) What is Regression Testing?
Testing of a previously tested program following modification to ensure that defects have not been introduced or uncovered in unchanged areas of the software, as a result of the changes made. It is performed when the software or its environment is changed.
17) What are different coverages in Function Testing?
Verifying the Functionality (external behavior) of a component or System
i) Input Domain Coverage
Verifying weather the system is accepting valid inputs or not? And preventing invalid inputs or not
ii) Output Domain Coverage
Verifying weather the System is providing correct Outputs or not, based on input and process
iii) Database Testing
Verifying the data validations, data storage and data retrieval operations
iv) Error handling
Verifying how the system is handling user unathurized/invalid operations and providing error and help messages.
v) Order of functionalities
Verifying weather the System is providing correct order of functionalities or not
18) What are the important operations in Database Testing?
Data Integrity,
Data Manipulations,
Data Comparisons,
Data Retrieval,
Data back-up and recovery operations etc…
19) What is Functional and Regression Testing?
20) Who uses QTP Tool?
HP- QuickTest Professional is an Industry leading Functional & Regression Test tool and it supports advanced keyword driven test approach.
Automatio Testers and End users use QTP Tool
21) What type of Scenarios can be automated?Tests that we have to execute on every build (Sanity Tests)
Tests that we have to execute on every modified build (Regression Tests)
Tests that we have to execute with multiple sets of test data (Data driven Tests)
22) What type of Scenarios can’t be automated?
Tests that require human user observation
Tests that requires one time execution



23) How to perform Cross platform testing and Cross browser testing using QTP? Can u explain giving some example?
You will need to create separate Actions which take care of different OS and Browsers
Cross Platform Testing:

Using the Built in Environment Variable you can dig up the OS information.

Eg. Platform = Environment("OS"). Then based on the Platform you need to call the actions which you recorded on that particular platform.

Cross Browser Testing:

Using this code  Eg. Browser("Core Values").GetROProperty("version") you can extract the Browser and its correspondin version. Ex: Internet Explorer 6 or Netscape 5. Based on this value you call the actions which are relevant to that browser.
24)Can we record an application running on a remote machine using QTP ?
Yes .you can record remote application provided you are accessing application through the local browser not via remoter like citrix.
If you are still unable to record it is advisable install QTP and application, on the same machine
25) Explain the keyword CreateObject with an example.
Creates and returns a reference to an Automation object
SYNTAX: CreateObject(servername.typename [, location])
Arguments
servername: Required. The name of the application providing the object.
typename :  Required. The type or class of the object to create.
location :  Optional. The name of the network server where the object is to be created.
Example : Set IE = CreateObject("InternetExplorer.Application")
26) Can you switch between Per-Action and Shared Object Repository ? If yes how ?
Yes .We can switch. Go to Test--->Settings--->Resources. Here  you have an option to choose repositories. 
27) When ordinal identifiers alone can make an object unique then why they are not given top priority? Why it is first mandatory and next assistive. Why we cannot go for ordinal identifiers directly?
Consider the following -
a) If two objects are overlapped on each other than location based object recognition will fail.
b) If only index based recognition is used your script will work but script execution time will increase.

Hence mandatory and assistive properties are used.
28) What is Step Generator?
Step Generator enables use to Add Test Steps in your script. Using step generator you can add steps to your script without actually recording it.
29) How to make QTP understand the difference amongst the  same type of objects .Suppose there are 5 check boxes in a page and I have to choose the 2nd one, how to do that through script?
You can use ordinal identifiers like index along with a little descriptive programming for object recognition.
Watch a video of this example.
30) What is Test Fusion Report ?.
Test Fusion Report , displays all aspects of a test run and is organized in a Tree format.
It gives details of each step executed for all iterations.
It also gives Run-time data table, Screen shots and movie of the test run if opted.
31) How can you handle exceptions in QTP?
In QTP Exceptional handling is done by using
a. Recovery Scenarios.
b. Using “On Error” statement
In Recovery scenario you have to define.
1. Triggered Events.
2. Recovery steps.
3. Post Recovery Test-Run.
At Script Level you can use the On Error Resume Next and On Error Go to 0 statement.
32) What is a Run-Time Data Table? Where can I find and view this table?
Data like parameterized output , checkpoint values , output values  are stored in the Run-time Table. It is an xls file which is stored in the Test Results Folder.  It can also be accessed in the Test Fusion Report.
33) What is the standard timing delay for web based application in QTP ?
The standard delay is 60 seconds. This is can be changed in Test Settigns.
34) What are the ways in UFT to get system environment variables in UFT?
There are three ways to get system environment variables in UFT
Use the WSH shell object
  • Use WMI’s Win32_Environment Class
  • Read variables from the registry
Set myShell = CreateObject (“WScript.Shell”)

WScript.Echo myShell.ExpandEnvironmentStrings( "%PATHEXT%" )

myShell=Nothing,
The output will be .BAT;.CMD;.VBS;. VBE;. JS;. JSE
Other user variable, like TEMP, overwrite their system counterpart
Set myShell = CreateObject( "WScript.Shell" )

WScript.Echo myShell.ExpandEnvironmentStrings( "TEMP=%TEMP%" )

myShell=Nothing
The output will be TEMP:C:\DOCUME~1\You\LOCALS~1\Temp
35) In UFT how you can prevent the system from getting locked?
To prevent system getting locked, any of the two ways can be used
  • Create a simple vbs file having code to press numlock key and run that vbs file
  • Edit one registry key “DisableLockWorkstation =1” to disable locking
36) Give the syntax to import/export xls into QTP.
 DataTable.ImportSheet "..\..\TestData\Input.xls",1,dtGlobalSheet

DataTable.ExportSheet "..\..\Results\Output.xls","Global"
37) Explain how you can fetch data from database in UFT?
Set db= createobject (“ADODB.Connection”)
db.Open 
“Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:\Raju\vb6\admission_project.mdb;
Persist Security Info= False

Set rst=createobject(“ADODB.Recordset”)
rst.Open “select*from Course”, db, 3
id=rst. RecordCount

For i=0 to id-1
Print rst.field (0) & rst.fields (1) & rst.fields (2) & rst.fields (3)
rst.Movenext
Next
38) Explain in what ways we can export datatable to excel in UFT?
To export data-table to excel, there are two methods.
a)      DataTable.Export (“C:\export.xls”)
b)      DataTable.ExportSheet “C:\mysheet.xls”   ( If excel file does not exist, new file is created)
39) In datatable sheet in UFT, how to read a value from the cell?
To read a value from the cell, we follow 2 step process
a)      We set the row pointer in first step
b)      In second step we define the parameter/column name from the sheet to read
Example:
For this example, we have set the row pointer to 2 in transaction sheet
Datatable.GetSheet(“Transactions”).SetCurrentRow(2)
Now, we have to specify that we want to read a value from the module_name column from the transaction sheet
   Print datatable.Value (“Module_Name, “Transactions”)
40) What are the types of error need to be handle in UFT?
There are three types of error that one will face in UFT
a)      Syntax Errors
b)      Logical Errors
c)       Runtime Errors
41) What are the ways you can handle run time errors?
There are various ways to handle run time errors
a) Using test settings
b) Using on error statement
c) Using err Object
d) Using Exit Statement
e) Recovery Scenarios
f)  Report Object
42) How to add synchronisation points in QTP?
There are 4 ways through which we can add synchronisation points in QTP
a) Wait statement :  This statement will pause the execution for x seconds until object comes up
b) Wait property : This method will wait until property of object takes particular value
c) Exist statement : This statement will wait until object becomes available
d) Sync method: The code will wait until browser page is completely loaded. For web application testing this method is used.
43) In QTP explain what is crypt object
Crypt object in QTP is used to encrypt a strings.
Syntax
Crypt.Encrypt(“Razu”)
Example :
In this example, value in pwd variable is encrypted using the Crypt. Encrypt method.
Then this encrypted value is entered into editbox.
 pwd= “myvalue”
pwd = Crypt.Encrypt (pwd)
Browser(“myb”).WinEdit (“pwd”). SetSecure pwd
44) How to define array in QTP?
Array can be defined in 3 ways in QTP
a) Fixed size array in QTP
Dim A (10) - single dimension
Dim MyTable (5,10) – multi-dimension

b) Dynamic array-size not fixed
Dim MyArray()ReDim MyArray(25)

c) Using Array Function in QTP
A= Array (10, 20,30)
B= A(2) ‘ B is now 30
45) When ‘option explicit’ keyword is used in QTP?
To specify that all variable must be declared before use in QTP,  ‘Option Explicit’ keyword is used.
46) In QTP how you can exit for loop?
You must use “Exit For” statement to exit “for loop” in QTP. “Exit For” statement will get the control out of the “for loop”
For count= 1 to 3
      TempNum= mid(Tempstr,count,1)
      If isnumeric(TempNum) Then
          LenghtNum = LengthNum & TempNum
      Else
      Exit For
      End If
Next
GetStrLenNumber = LengthNum
47) What is the significance of “action 0” in QTP?
“Action 0” is created by default when you create a new test in QTP along with action 1.  To determine the sequence in which we call other actions 1,2,3 etc. action 0 is used.
48) How you can check if parameter exists in Datatable?
To check whether if parameter exists in data table we will use the code
on error resume next
val=DataTable(“ParamName”, dtGlobalSheet)
if err.number<>0 then
     ‘Parameter does not exist’
else
      ‘Parameter exists
end if
49) In QTP how you can use Xpath to identify objects?
Xpath can be used to identify only web objects. We can use the following code to identify objects.
Set oPage=Browser(“myGoogle”).Page(“myGoogle”)
oPage.WebEdit(“xpath:=//INPUT[@name=‘nameofeditbox’]”).Set “search term”
‘Enter value in google edit box
50) Explain how you can delete excel file in QTP? 
To delete excel file in QTP, 
Set fo = createobject(“Scripting.filesystemobject”)
fo.deletefile(“C:\xyz.xlsx”)
Set fo=nothing