| || |
Reading and writing to tables in funstions
User (email@example.com) posted:
I have been trying to solve this problem for sometime now
When I try to read or write to a table in a compiled module, it will not
I have worked with merc int support for the past week or so. To no avail,
the same script that I run on my machine will not read or write
to a table but, it will write to the table on there machines.
It even came to the point of merc int using a web ex session to try and
debug my script for me on my machine. It still will not read or write from
the table inside of compiled module
I know there is a simple reason, maybe something I did in the set up of WR
or maybe Of my OS
Well any help would be appreciated.
Here are the facts.
WR 7.0 ( upgraded to 7.01 still did not work)
Windows 2000 Professional.
Here is the simple test script I have been using
app_path = "C:\\Program Files\\Mercury Interactive\\WinRunner\\example\\";
rc=reload(app_path & "write_function");
extable = app_path & "table.xls";
rc = ddt_open(extable, DDT_MODE_READWRITE);
if (rc!= E_OK && rc != E_FILE_OPEN)
pause("Cannot open table.");
for(extable_Row = 1; extable_Row <= extable_RowCount; extable_Row ++) # Start of loop
write_function(extable, "something", extable_Row);
here is the function
public function write_function (inout table, in text,in extable_Row)
#ddt_set_val(table, "Comment", text);
the table just has two columns
After the test is run the Comment Column should have the
text "something" in it for every row that has an entry in the "Data" Column.
Re: Reading and writing to tables in funstions
User (firstname.lastname@example.org) posted:
Since you are passing all of relevant information to your function ( table
name and row ) , place of the opening and closing of the file inside the
function that does the actual writing, then the data table will be linked
to that function as it runs and it should write correctly.