Friday, February 22, 2013

Automation Testing (QTP) Interview Questions

1) What is Automation testing?
Automation testing means that the execution of 'test scripts' on SUT to compare expected and actual result.

2) Name some automation testing tools?
QTP, Selenium, Load runner, Jmeter , Watir, Sahi, Test complete, Silk test,Winrunner,RFT and etc.

3) Define about QTP?
QTP is a functional testing tool developed by HP. QTP will run on windows computer like XP,Vista,and seven like client side OS and 2003 server, 2008 server like server side OS which can detect defect from  software.

4) Why the Automation testing is preferable?
To decrease the time in testcase execution on SUT testers are going for test automation.

5) What is meant by Test Automation?
Test Automation means conversion of test cases into pragmatical testscripts.

6) Mainly for which type of functional tests, testers are preferring the automation testing?
For sanity , regression and final regression functional tests, testers are preferring the automation testing.

7) What is the need of automation testing in functional testing?
Automation testing is possible for regression levels of functional testing to save time.Because, manually sanity and regression testing are taking more time. Due to this reason testers are going for automation funtional testing using QTP like tool.

8) Which type of functional test cases are preffered for automation?
Test that need to run for every build.
Tests that use multiple data values for some action
 Identical functionl tests that need to be executed using different browsers.

9) Which type of functional test cases are not preffered for automation?
Test cases that are executed only once.
Test cases used for adhoc/random testing.
Test cases that are infrequently selected for execution.
Test cases that need manual interaction i.e., a task that not possible to automate.

10) What is a Test script?
An automated program in QTP is called as Test script.

11) By using how many languages testers are writing test scripts in QTP? and name them?
By using 4 languages they are as follows: VBSript/Jscript,QTPScript,SQL, .Net factory.

12) What is QTPScript?
QTP testing tool is having one language inbuilt called as QTPScript. It is an object based language. Object based language means that the language with inbuilt objects. Object means that it is an interface to access the objects in SUT.

13) In QTP tool when we are using web add-in for testing?
When our SUT is developed in HTML, then the test automators can launch the QTP tool with web add-in.

14) What are the  objects in QTPScript?
Browser, Page, Webdit, Webradiogroup, Webbutton, Webcheckbox, link, Image, Webfile, Webelement, Webtable Weblist and etc.

15) What is the object and method used for launching the website?
'Systemutil' object and 'Run()' method is used for lunching the website.

16) what are the methods are used while working with the password objects?
Set() and setsecure()methods are used while working with the passwords. But here, set() is taking the original password and setsecure() is taking encrypted password.

17) What are the two ways that are used for encrypting the password?
By using the Pass encoder option wich is present in the Tools menu and other way is by using the utility object 'Crypt' and method Encrypt().
Syntax: crypt.encrypt("xxxxxx").

18) Upto how many seconds QTP tool is maintaining delay in the execution in fast mode?
QTP tool is maintaing the delay in execution for 20 seconds in fast mode and after every statement and before going to next statement in normal mode. whereas, QTP tool will maintain delay in execution when SUT is slow in fast mode.

19) In how many ways QTPscript can be generated?
In 4 ways QTPscript can be generated such as by typing (Descriptive programming,)using Record icon, Object repository, Step generator.

20) What is the difference between Recorded programming and  Descriptive programming?
In recorded programming or object repository or step generator program based QTPScript code is maintaining description of SUT objects in object repository. But, typed QTPScript will maintain SUT objects descriptions in code itself. So, typed QTPScript is easy to modify.

21) What are Utility objects?
Utility objects are having properties and methods to provide extra facilities to testers in SUT automation.

22) What are Functions in automation?
Functions are providing some generic activities to test automators like printing, stop testing, executing the external files and etc.

23) What is the use of 'With' statement in QTP?
'With' statement separates the parent object and the child objects.

24) Which method is preferable for automation testing?
Descriptive programming is more preferrable.Because, after recording if we lost objects description in the object repository or if any of the objects in SUT were modified then it is very difficult to make changes. Due to above two reasons descriptive programming is more preferable.

25) Into how many ways SUT's are classified?
In general SUT's are divided into CLI (Command line interface), GUI(Graphical user interface) And No interface. Again in GUI windows based (1 tier, 2 tier), mobile based, and web based (3 tier and N- tier).

26) For automation testing why we need QTPScript anlong with VBScript?
QTPScript language is having test objects, utility objects, functions and statements.These topics of QTPScript are not sufficient for complete website test automation.But VBScript language is providing varibles,arrays, functions,operators and conditional statements,loops and components.

27) What is VBScript?
VBScript is one of the programming language which is developed by the Microsoft derived from visual basic 4.0 inbuilt in windows operating system.

28) What are conditional statements in VBScript?
Like as programming languages VBScript is also providing conditional statements like IF ELSE,SELECT CASE  and etc.

29) What is the use of IF-ElSE statement?
To run a block of code depends on 'Condition' we can use this statement.
Syntax: If condition then

30) What is the use of SELECT CASE statement?
To run a block of code depends on 'Value' we can use this statement.

31) What is 'description of object' indicates in QTPScript?
The utility object is allowing test automators to specify the description for required type of objects in SUT.
Syntax:                 Set variable name=description.create
                variable name('micclass').value=object name in SUT.

32) Write any example (for example image object)for creating the description object?
Set desco=description.create

33) What is the use of loops in VBScript?
Like as other programming languages, to run a block of code more than one time we are using loops in VBScript.

34) What is the use of FOR-loop?
To execute a block of code more than one time in specified limit we are using FOR-loop.
Syntax: for i=1 to step 1

35) What is the difference between FOR-loop and WHILE-loop?
FOR-loop is count based and WHILE-loop is condition based.

36) What is the difference between WHILE-loop and DO WHILE-loop?
WHILE-loop is checking the condition at first and executing as long as the condition is true. But, DO WHILE-loop is first executing the condition and after it will check the condition. Here at least one time block of code will be executed in DO WHILE loop.
Syntax for while loop: 
                 While condition
Syntax for do while loop:
loop While condition

37) What are the statements that are used for terminating the infinite loop,do-while and while until loops,infinite FOR-loop?
'Exit do' statement is used for terminating the infinite loop,do-while and while until loops  and 'Exit for'  the statement is used for terminating the infinite FOR-loop.

38) What is the use of 'regular expressions' in QTPScript?
Some times SUT objects are having lengthy names or titles and SUT objects titles or names are dynamically changes.To handle these two situations we are using the regular expressions in QTPScript.

39) How to handle the situation when developers are givien same name or title to multiple objects while writing the automation scripts in QTP?
To distinguish the similar objects names in QTP test automators aare using ordinal identifiers like 'index', location, and creation time (for browser object).

40)What is the use of 'INDEX' property in QTP?
When developers given same names for all the same type of objects in SUT then, we are using the 'INDEX'  property.

41)What is the use of 'LOCATION'property in QTP?
Location property will be used when developer used same type of object for different labels.

42) What is use of 'CREATION TIME' property'in QTP?
While working with the Browser objects, test automators are using 'creation time' property.
For example creation time is '0' for 1st opened browser after launching QTP tool and then recently opened browsers are getting creation time 1,2 ,3,...... etc.

43) When we will use the FOR EACH loop?
We can use the FOR EACH loop to run  a block of code more than 1 time depends on a group or list or an array.

44) What is an 'Array' in VBScript?
A collection of data is called as an array.
Syntax: option explicit
                Dim Array name(size of an array)
example: option explicit
                     Dim x(5) (Here x is an array of 6 elements which is indexing from 0-5).

45) What is 'List' in VBScript?
A collection of objects is called as 'List'. Arrays and List both index will start from '0'.

46) How we can increase the size of an array dynamically? and what is the disadvantage of that statement? How we can overcome from it?
We can increase the size of array dynamically by using 'REDIM' statement. But the disadvantage of this statement is that it is destructing the previously allocated memory and create the fresh new memory. Due to this reason we are losing the previous data. To prevent this destruction we can use the below type of statements.
Option explicit
Dim x()
Redim x(array size)
Redim preserve x(Array name)

47) How can we make list of objects in QTP?
To make list of objects, at first we should create 'description' for required object in SUT and then collect references for all the objects in SUT into a variable called as list in VBScript. So, one VBScript consists of references to multiple objects in SUT.

48) What are the differences between arrays and lists?
a) Array is the collection of dissimilar values and list is the collection of similar type of values.
b) Redeclaration is possible in array and redeclartion is not possible in list .
c) Use array in code by using array name and index. Use list in code by using list name and index.

49) Why we use functions in QTPScript?
After getting the data from SUT screens by running the QTPScript code test automators  are using the functions to validate that data.

50) Name some functions in QTPScript?
Inputbox(), Msgbox(), Array(),is numeric(),Date(),Time(),Now(),Month(),Day()Year(),weekday(),minute(),second(),datediff() instr() and etc.

51) In how many ways we can launch SUT? and what are they?
In two ways test automators are launching the SUT i.e., by using the system util object and run() method. The other way to launch SUT is that by using the Invoke application() function.
Syntax:"Path of SUT")
bro="c:\programfiles\internet explorer\iexplorer.exe"
invoke application(bro&""&Url)

52) By using which function we can create an object for specified component?
By using Create object() function in VBScript we can create an object for specified component.

53) What is the use of components in VBScript?
VBScript language is having some build in components. By using those components, test automators are creating the objects to access external files and softwares like .txt,.doc,.xlsx,Ms-outlook,SUT databases, and etc.

54) Which component is used to work with the Ms-excel?
In general, manual testers are using Ms-excel to write test cases along with testdata.So, test automators need to use Ms-excel in test automation using QTP. And VBScript language is providing "Excel.application" component.

55) Which function is used to define the sleeping state in execution?
To define the sleeping state in execution we are using Wait() function.

56) When we are using the mouse automation?
In general analog recording concept was used for mouse automation. Mouse automation was needed in QTP when some of SUT objects are not responding in automation.
syntax: Window("page/window title").Runanalog("track name")

57) How many color indexes thus VBScript supports on Ms-excel?
VBScript is supporting 56 color indexes for 56 colors ranging from 1 to 56.

58) How many indexes thus VBScript supports for charts or graphs on Ms-excel?
Total 9 indexes thus Ms-excel application is supporting ranging from 61 to 70.

59) Which property thus test automators are using for objects in pop-up windows?
While writing the QTPScript code for pop-up windows automation in DP, test automators can use 'text' property for objects in pop-up windows.

60) Which function we are using to compare the two strings?
We can use Strcomp() function to compare the two strings. If both are same then it  returns 0. If first string is greater than second string in alphabetical order then it returns 1.

Recommend on Google



Popular Posts