09-08-2009, 03:40 PM
Hi Ramesh
I would like to try to explain this with an example
Say you have a page in which there are multiple Submit buttons
if you want to click each button one by one.
In that case if you use static DP then you will have to uniquely identify each button and then click each one which will take you to the repeateative steps
but using Dynamic DP you can do this easily using childobjects and a loop.
I must say here that there is no rule that we have to use static or dynamic. we should always decide this based on the situation we are in.
hope I am able to clarify the point to you.
I would like to try to explain this with an example
Say you have a page in which there are multiple Submit buttons
if you want to click each button one by one.
In that case if you use static DP then you will have to uniquely identify each button and then click each one which will take you to the repeateative steps
but using Dynamic DP you can do this easily using childobjects and a loop.
Code:
static
Browser("micclass:=Browser").Page("micclass:=Page").WebButton("micclass:=Button", "name:=Submit", "index:=1").Click
Browser("micclass:=Browser").Page("micclass:=Page").WebButton("micclass:=Button", "name:=Submit", "index:=2").Click
Dynamic
Set oButton = Description.Create
oButton("micclass").value = "Button"
oButton("name").value = "Submit"
set oButtons=browser("micclass:=Browser").page("micclass:=Page").ChildObjects(oButton)
For cnt=0 to oButtons.count-1
oButtons(cnt).Click
Next
hope I am able to clarify the point to you.