Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
static vs dynamic dscritve programing
#5
Solved: 10 Years, 10 Months ago
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.
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
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.

Reply


Messages In This Thread
RE: static vs dynamic dscritve programing - by Saket - 09-08-2009, 03:40 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to control WAIT time with STATIC variable? chong67 3 3,840 06-22-2012, 10:38 AM
Last Post: sshukla12
  Object Repository and Discriptive Programing combination raaj123 1 2,491 05-22-2012, 08:32 PM
Last Post: Ankesh
  descript programing rjkmr.aiht 1 2,121 04-13-2012, 05:47 PM
Last Post: vinod123
  How to write the desriptive programing for gmail signin and signout shwetha_m 2 3,865 02-01-2012, 10:45 AM
Last Post: shwetha_m
  Automating/Testing - static and dynamic text in PDF Sravs7 0 1,733 10-24-2009, 07:47 AM
Last Post: Sravs7

Forum Jump:


Users browsing this thread: 1 Guest(s)