HP QTP 10 Certification HP0-M39 Sample Questions

1. How can you add recordable or non-recordable operations to your test? (Select three.)
A. Use the Step Generator.
B. Insert through Keyword View.
C. Drag objects from the object repository.
D. Drag objects from the Active Screen.
E. Drag objects from Available Keywords.
F. Drag objects from the Data Table.
Answer: ABE
2. What is a QuickTest Professional test comprised of?
A. calls to actions
B. calls to actions (reusable only)
C. calls to QuickTest Professional tests
D. calls and copies of actions
Answer: A
3. Which names are used to identify the status of your application before and after your automated test executes? (Select two.)
A. initial condition
B. static state
C. end condition
D. down condition
E. done condition
Answer: AC
4. During the planning phase, you decide to create multiple actions that can be combined and reused to achieve testing goals. Which element is critical for identifying the actions to be recorded and how to combine them?
A. input data
B. parameters
C. initial and end conditions
D. visual cues
Answer: C
5. What are the default add-ins installed with QuickTest Professional? (Select three.)
A. .NET
B. ActiveX
C. HTML
D. Web
E. Java
F. OCX
G. Visual Basic
Answer: BDG
6. Which Quick Test Professional View Option will show you the repositories associated with each action?
A. Resources
B. Information
C. Script Repository
D. Active Screen
Answer: A
7. Where can you reset the add-in manager if it does not display when you launch QuickTest Professional?
A. General Options
B. Run Options
C. Test Properties
D. Test Settings
Answer: A
8. You set your Record and Run settings to Record, and then run a test on any open browser. Which applications will be recorded? (Select two.)
A. Firefox
B. Safari
C. Silverlight
D. Chrome
E. Internet Explorer
Answer: AE


Click Here to Download the set of 75+ questions

Count the number of check boxes available in the webpage by QTP – Childobjects method

Working with Child Objects – Part 1 - Description Programming, Count ChildObjects, Enumerating ChildObjects

In this post we will discuss:

  • Count the number of check boxes available in the webpage
  • Check All Checkboxes in the webpage

You can copy and pate the below code in QTP and run the script.

'  - - - - - - - - - -  Count & check the number of check boxes available in the webpage '  - - - - - - - - - - 

SystemUtil.Run "iexplore.exe", “http://www.onestopsoftwaretesting.com/qtptest.html”

'Create a Description object
Set dpAllChk = Description.Create

'Define the class of the above created Description object
dpAllChk("micclass").value = "WebCheckBox"

'Getting all the textboxes
Set Allchk = Browser("Browser").Page("Page").childobjects(dpAllChk)

Allchk(0).set "ON"

'count all the textboxes
chkcount = Allchk.Count

msgbox chkcount &  " check boxes are available in the webpage"

'Check all textboxes in the webpage
icounter = Allchk.Count -1
For i = 0 to icounter
Set otext = Allchk.item(i)
‘item property - Exposes a specified item from a collection.
otext.set "ON"

Next

'  - - - - - - - - - - - - - - - - End  - - - - - - - - - - - - - - - -

Description Programming, Count ChildObjects, Enumerating ChildObjects

Description Programming - Enumerating ChildObjects.

In this tutorial, We will learn the basics of ChildObjects i.e. to count the number of objects available in a webpage.We will do following exercises:

  • 1. Count the number of text boxes available in the webpage
  • 2. Enter data in all the textboxes in a webpage
  • 3. Count the number of check boxes available in the webpage
  • 4. Check All Checkboxes in the webpage
  • 5. Count the number of buttons available in the webpage
  • 6. Count the number of Links available in the webpage

ChildObjects method is used to retrieve all objects located inside a specified parent object. In our current example, parent object is a webpage. To reterive the childobject, we must create a description object.Check the below example Count the number of text boxes available in the webpage by QTP:

[Note – For practice, you can use webpage - http://www.onestopsoftwaretesting.com/qtptest.html. You can copy and pate the below code in QTP, It will work flawlessly]

SystemUtil.Run "iexplore.exe", “http://www.onestopsoftwaretesting.com/qtptest.html”

'  - - - - - - - - - -  Count the number of text boxes available in the webpage  - - - - - - - - - - 
'Create a Description object
Set dpAllTxt = Description.Create

'Define the class of the above created Description object. 'In this example, we are counting the number of text boxes, so we are defining "WebEdit"
dpAllTxt("micclass").value = "Webedit" 

'Getting all the textboxes
Set Alltxt = Browser("Browser").Page("Page").childobjects(dpAllTxt)

'count all the textboxes
txtcount = Alltxt.Count

msgbox txtcount &  " text boxes are available in the webpage"

'Enter data in all textboxes in the webpage
icounter = Alltxt.Count -1
For i = 0 to icounter
Set otext = Alltxt.item(i)
' item property - Exposes a specified item from a collection.
otext.set "This is text box #" & (i+1)

Next

'  - - - - - - - - - - - - - - - - End  - - - - - - - - - - - - - - - -

More examples in upcoming posts..

More Examples -

Count the number of check boxes available in the webpage by QTP – Childobjects method

References -

  • QTP Help
  • QTP Unplugged book – by Tarun Lalwani