DBTable - Interacting with a DBTable if it is a passed parameter to a function\routine
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
DBTable - Interacting with a DBTable if it is a passed parameter to a function\routine
Hi
I currently have a DB table variable which is a variable of a keyword test. The DBTable is pointing to a spreadsheet stored on the local computer.
The keyword test calls a function and I pass the DBtable variable as a parameter.
The DBTable object is visible and passed when I inspect it via the watch list as it shows the columncount.
My problems come when i try to interact with the passed variable as nothing i have tried appears to work.
Do you have any documentation or examples to show how to interact with the passed DB Table variable.
I want to iterate through all the columns and rows and extract the stores values.
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you post what you've done to date? That would be helpful in determining, perhaps, why it's not working and give a better proposed solution.
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just as a note, I tried it and it's working fine for me. I have an Excel spreadsheet with two columns in it: Value1 and Value2. I have that spreadsheet assigned to a DBTable variable on a keyword test. I then pass that variable to the following function. My log shows the values of each column for each row as I iterate through the rows from beginning to end.
function testDBTable(myTable) { while (!myTable.IsEOF()) { Log.Message('Column 1 data: ' + myTable.Value('Value1')); Log.Message('Column 2 data: ' + myTable.Value('Value2')); myTable.Next(); } }
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, that works.
