Tuesday 26 November 2013

When to use descriptive Programming in QTP

Descriptive programming in QTP is used in below scenarios.

  1. Whenever the objects in the applications change quite often.
  2. When it is not feasible to store the objects in OR. For example all links on the page
  3. When same object exists in the different pages/windows of the application.

There are 2 types of description programming.

  1. Static Descriptive programming
  2. Dynamic Descriptive programming

Static Descriptive programming Example - 

 Browser("index:=0").page("title:=Google").webedit("name:=q").set "xyz"

Dynamic Descriptive programming Example - 
'Find all edit boxes on google page using descriptive programming
Set descriptionObject = Description.Create()
descriptionObject("micclass").value = "webedit"
descriptionObject("outerhtml").value = ".*input.*"
descriptionObject("outerhtml").regularexpression = true

set col = Browser("index:=0").page("title:=Google").childobjects(descriptionObject)

print "Total edit boxes on the page"  & col.count

For i=0 to col.count-1
print col(i).getROProperty("outerhtml")

Next

You may also like below topics on descriptive programming in QTP.

  1. Using regular expressions in QTP.
  2. How to by pass OR in QTP.
  3. Description object in QTP.


Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts.

No comments:

Post a Comment

Please Leave your reply. We value your feedback and inputs

Best QTP Books

Everything About QTP

Hello Friends,
You can find QTP study material, Multiple choice questions (mcq), QTP question bank, QTP question papers, QTP notes, QTP questionnaire, scenario based QTP interview questions, QTP tutorial and QTP training on this site.

If you are a fresher or experienced QTP professional with (1/2/3/4) years of experience, this blog is just for you.