software testing genius

Rehearsal of QTP in 1 Hr-Interview Questions 161-170

Welcome to “Software Testing Genius”. Subscribe to my RSS feed for latest content on Software Testing.

Rehearsal of QTP in 1 Hr: Interview Questions 161 170

While appearing in an interview for a position on HP QuickTest Professional, do a quick rehearsal of your knowledge on this tool.

Here is a collection of 180 short questions, QTP Managers commonly use while interviewing new aspirants for their organization.

The entire rehearsal of these questions can take less than an hour.

Set of Ten Questions

Q. 161: How do you know the no of links in a web page?

Answer -1: By Page Check point,

Answer-2: By following set of statements:

Set PageDesc = Description.Create

PageDesc("Class

Name").Value = "Link"

Set Pages = Browser("Mercury Interactive").Page("Mercury Interactive").ChildObjects(PageDesc)

Number_of_pages = Pages.Count

If Number_of_pages = 0 Then

Reporter.ReportEvent micDone, "No links was found in the web page, ""

End If

<<<<<< =================== >>>>>>

Q. 162: How can I check if a checkpoint passes or not?

This can be done by the following code.

Code:

chk_PassFail = Browser(...).Page(...).WebEdit(...).Check (Checkpoint("Check1"))

if chk_PassFail then

MsgBox "Check Point passed"

else

MsgBox "Check Point failed"

end if

<<<<<< =================== >>>>>>

Q. 163: My test fails due to checkpoint failing. Can I validate a checkpoint without my test failing due to checkpoint failure?

This can be done by the following code.

Code:

Reporter.Filter = rfDisableAll 'Disables all the reporting stuff

chk_PassFail = Browser(...).Page(...).WebEdit(...).Check (Checkpoint("Check1"))

Reporter.Filter = rfEnableAll 'Enable all the reporting stuff

if chk_PassFail then

MsgBox "Check Point passed"

else

MsgBox "Check Point failed"

end if

<<<<<< =================== >>>>>>

Q. 164: How can I import an environment from a file on disk?

Environment.LoadFromFile "C:Env.xml"

<<<<<< =================== >>>>>>

Q. 165: How can I check if an environment variable exist or not?

When we use Environment("Param1").value then QTP expects the environment variable to be already defined.

But when we use Environment.value("Param1") then QTP will create a new internal environment variable if it does not exists already.

So to be sure that variable exist in the environment try using Environment("Param1").value.

<<<<<< =================== >>>>>>

Q. 166: How to connect to a database?

This can be done by the following code.

Code:

Const adOpenStatic = 3

Const adLockOptimistic = 3

Const adUseClient = 3

Set objConnection = CreateObject("ADODB.Connection")

Set objRecordset = CreateObject("ADODB.Recordset")

objConnection.Open "DRIVER={Microsoft ODBC for Oracle};UID=;PWD=

"

objRecordset.CursorLocation = adUseClient

objRecordset.CursorType = adopenstatic

objRecordset.LockType = adlockoptimistic

ObjRecordset.Source="select field1,field2 from testTable"

ObjRecordset.ActiveConnection=ObjConnection ObjRecordset.Open 'This will execute your Query

If ObjRecordset.recordcount>0 then

Field1 = ObjRecordset("Field1").Value

Field2 = ObjRecordset("Field2").Value

End if

<<<<<< =================== >>>>>>

Q. 167: How do you create a Template for every Actions?

Write the template script as "ActionTemplate.mst" in DAT folder of QTP Installation

<<<<<< =================== >>>>>>

Q. 168: Test -->Settings --> Run tab belongs to which sheet:

Global Data sheet

<<<<<< =================== >>>>>>

Q. 169: What is the first step in editing an object in the object repository?

Enable Editing

<<<<<< =================== >>>>>>

Q. 170: When using recovery scenario wizard, the first phase is to specify?

Triggered Events

Continue to Next Set of QTP Rehearsal Questions 171 - 180

Study Material - HP QTP & QC Certification Exam

Study Material - HP LoadRunner Certification Exam

Study Material - IBM RFT Certification Exam

What Successful Testers say about the Quality of this website

If you want to keep track of further articles on Software Testing,
I suggest you to subscribe my
RSS feed
.

You can also Subscribe by E-mail
and get All New articles delivered directly to your Inbox.

Full Study Material for Popular Certification Exams:

Largest Database of Sample Papers - 1000+ Unique Questions for ISTQB Foundation Exam

ISTQB Foundation Exam - Full Crash Course for Download

ISTQB Advanced CTAL Test Analysts Exam - Full Crash Course for Download


ISTQB Advanced CTAL Test Manager Exam - Full Crash Course for Download


Study Material - ISTQB Certification Exam

Consolidated Study Material - Testing & QA


Most Popular Topics in Demand:

Practical Roadmap to QTP Certification

Practical Roadmap to CSTE Certification

General HR Interview Questions Common For All 

Tricky HR Interview Questions Common For All
 

Rehearsal of LoadRunner in 1 Hr. -  Interview Questions

 

Comments :

0 comments ↓


Leave Your Comments: (*) Marked Fields are Mandatory

You can apply basic formatting to the text

Name *
 
Email Address *
 
Website
 
Speak your mind
characters
sex hikayeleri