How i can write the script for the runtime changing objects
For Example My webtable name is "Wtable" Its containing n number of links "120 orders" "130 orders" "100 orders"....... These orders text will dynamically changing like "120 orders" can be change as "121 orders" In this how can i write code for click these links in this webtable
First i count the child objects in "WTable" Its now written 3 It may be change as 4 or 5 in Run time (no prob for count its takes the value) But i cant write the code for click these links dynamically If i write the code Browser(B).Page(P).Link("120 orders").click (Runtime this text may change)
So i have to write this script in this childObjects count function itself.
I'd get all the link objects for the page or object that match a certain criteria. In this case all your order links match ".*orders" then run a loop to click each of them
For example:
' Set up an object description array for matching links Set arrObjectDescriptionField Description.Create()
' Set our link match criteria arrObjectDescriptionField("html tag").Value "A" arrObjectDescriptionField("text").Value ".*orders"
' Retrieve an array of objects from the browser that match ' the description criteria Set arrObjectsLinks Browser("MyBrowserName").Page("MyPageName").WebTable("MyTableName").ChildObjects(arrObjectDescriptionField)
' Count the number of links found that are stored in the array intObjectCountTotal arrObjectsLinks.Count
' Run one iteration for each link For intObjectIterator 0 to intObjectCountTotal - 1
' Click on the link arrObjectsLinks(intObjectIterator).Click
' Your verification code should go here along with code to bring you back to the original web page.
' After you come back from the page you clicked on you will need to ' re-index the array of browser objects otherwise it will cause a ' runtime error (Unless your links open in a new window) Set arrObjectsLinks Browser("MyBrowserName").Page("MyPageName").WebTable("MyTableName").ChildObjects(arrObjectDescriptionField)