Customer Center

Welcome back

My Account Logout
#4962

Many elements on a web page can be thought of as a container. Some are obvious, like a TABLE contains any number of TR elements (rows), and each TR could contain any number of TD (cells) elements. Dropdowns (SELECT) have OPTION elements; but even formatting elements also can be thought of as a container, for example a a B tag (bold) could format a A (hyperlink) element.

 
Containers have a general method for accessing their members, and for some container specific methods. A TABLE for example can be read easily using our Web1.Table command. If lower level access to the individual items inside a table you can access the Rows collection,and each Rows.Item has a Cells collection:
For i=0 to Web1.Selected.Rows.Length-1 
Web1.Selected.Rows.Item(i).Cells.item(0)
Next i
A SELECT tag has an Options collection – all the available items inside the combo box.
 
All containers have an All collection – everything inside the container. For example let’s imagine the first cell from above had a hyperlink inside it that you wanted to click. The link could be the 1st item inside the cell’s All collection:
Web1.Selected.Rows.Item(i).Cells.item(0).All.Item(0).Click
 
Now, before you go writing stuff like the above – make sure you really need to!
 
I may have been able to click the hyperlink above with a simple, learned web command – Click “My Link Text<A>”. Don’t fall into the trap of having a hammer and now you treat all problems as nails.