Descriptive programming in QTP is used in below scenarios.
There are 2 types of description 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.
Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts.
- Whenever the objects in the applications change quite often.
- When it is not feasible to store the objects in OR. For example all links on the page
- When same object exists in the different pages/windows of the application.
There are 2 types of description programming.
- Static Descriptive programming
- 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.
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