Forum Discussion

Ragusa's avatar
Ragusa
Occasional Contributor
9 years ago

Why is my Table Update not permanent?

I made a Table Checkpoint from application Orders with the addresses given by MyTable.tbl and stored it under the name TestTable2. Then I wrote a little JScript that changes the name in row 5 of TestTable2 ("Samuel Clemens") to "New Cell Value" and compares it to the MyTable.tbl:

 

function Table_Update3()
{
  //Runs the "Orders" tested application.
  TestedApps.Orders.Run();
  //Moves the mouse cursor to the menu item specified and then simulates a single click.
  Aliases.Orders.MainForm.MainMenu.Click("File|Open...");
  //Opens the 'C:\TestComplete\Workshop\MyTable.tbl' file via the 'dlg_ffnen' dialog.
  Aliases.Orders.dlg_ffnen.OpenFile("C:\\TestComplete\\Workshop\\MyTable.tbl", "Table (*.tbl)");
  var Table, Value;
  // Obtains the Table object
  Table = Tables.TestTable2;
  // Changes the value stored in the table
  Table.Values(5, 0) = "New Cell Value";
  // Compares the modified table data with the data displayed by the control
  Table.Compare(true, lmError);
}

 

The Log Entry is as expected:

"The "Customer Name" column of row 5 contains a value (Samuel Clemens) that differs from the stored one (New Cell Value)."  

 

But looking at TestTable2 afterwards, there is still "Samuel Clemens" and not "New Cell Value". Why is the change just honored during the script but lost afterwards?

3 Replies

    • Ragusa's avatar
      Ragusa
      Occasional Contributor

      Thank you Joseph. You're right, for some reasons, I don't quite understand, just a copy is updated and after the test everything is lost. Is there a way (an option?) to make the changes permanent? I mean an automated way, through a script or so, and not manually through a dialog.

      • joseph_michaud's avatar
        joseph_michaud
        Moderator

        I haven't been able to find a way to create a new table programatically, or modify one permanently.  It seems that the only way to update a table is by manually selecting the "Update Table elements" option, and then doing a Compare.

         

        Stores Options Dialog