| || |
Extracting data from an HTML table....
User Lignowski, Stephen (email@example.com) posted:
I am trying to get data out of an HTML table and into some kind of variable,
however, the two options open to me, the HTMLTableVP, using either the
CompareData or CompareProperties isn't working. I can use GetProperty to
retrieve the text, but the innerText and outerText properties have all of
the data items concatenated together in one long string. The HTMLTableVP
CompareData separates everything out into individual columns, but I can't do
anything with the data; it all goes into a compare file that I can't get to.
I'm using a data driven type of testing in that we are running multiple
tests with different data but the same code in a loop. Obviously I can't
use the same compare each time, but I need some way of verifying the
[I'd look in the forest, but all these damn trees are in the way...]
Senior QA Analyst
Re: Extracting data from an HTML table....
User Rick Wellinghoff (RWELLINGHOFF@remember.com) posted:
Use an Object Properties VP and use the Browse option rather than the
"Finger" to find the table cell you are looking for. The innerText and
outerText properties will capture the text in the cell but it won't really
be a variable when you convert to an SQAGetProperty. It will work well when
the value of text in that table cell remains the same, but the
SQAGetProperty function won't see anything if the value changes.
I've found that you can do a CTRL-Click on the text to highlight it,
Right-Click, Copy, and use a Variable=Clipboard.GetText() to assign a
variable to the text in that cell.