| || |
How to parse an html page.obj: line by line ?
Using TestComplete 7.52 / .NET 3.5 SP1 / WinXP SP3
I have a script in which I obtain the web page.obj, save to file, and
use the following to go line by line looking for certain information to
create an array.
aString = F.ReadLine();
The web page I am dealing with has drop-down menus that go 1, 2, and 3 deep in layers.
Dev is always changing the menuitem numbers so the drop-down menus are dynamic lately.
I want a way of when coming to the page, I can easily create an array containing the
appropriate information. When the names are provided for what to click on, the index
can be accessed, and the statements constructed to click on the drop-menu items
I was wondering if there is an easier to to use the page.obj (without saving to file)
and parse the page.obj line by line and also know when the end of the page.obj is reached.
Currently, I store the information as follows:
- MenuLayer corresponds to the array index
- MenuItem num and MenuItemText are stored into the appropriate array location
Re: How to parse an html page.obj: line by line ?
Please clarify what you mean by 'page.obj'.
I think that you can read the needed information from the page by looking into the HTML code of the corresponding objects. You can get the HTML code using the outerHTML property. If you have problems parsing this information, please post here the HTML code retrieved via the outerHTML property that contains the needed information.