Forum Discussion

MadhuLambu's avatar
MadhuLambu
Contributor
28 days ago

External table is not in the expected format

I use a DB Table / Excel worksheet that has the parameters for my test that are run in iterations.  Lately, I get this randomly.

External table is not in the expected format

Has anyone seen this error?

Thanks in advance,
Madhu

    • MadhuLambu's avatar
      MadhuLambu
      Contributor

      Am running from within the IDE that is installed in Program Files (x86).  Because it's in the (x86) folder, I assumed it is 32 bit, but Task Manager clearly shows it's 64 bit.

       

      • Hassan_Ballan's avatar
        Hassan_Ballan
        Contributor

        TestComplete and TestExecute are shipped with both 32 and 64 bit flavors and both are installed in the "Program Files (x86)" folder.
        C:\Program Files (x86)\SmartBear\TestComplete 15\Bin\*.exe
        C:\Program Files (x86)\SmartBear\TestComplete 15\x64\Bin\*.exe
        Use Windows "Task Manager" > "More details" > Details > and look at the Image path name for the correct version you are running. Most likely the 64 bit.



        To access Excel you also need proper Microsoft Office driver dependent on your Office version, as well as TesCOmplete/TestExecute bit version explained in this Using Excel Files as Data Storages | TestComplete Documentation (smartbear.com)

        Also you may find that such Microsoft Office drivers are no longer available, saving your file in a lower version of Excel version (such as .xls not ,xlsx) may solve your problem.

  • I have a variable defined on the project of Type 'DB Table'.

    Here's the code snippet am using,

    let sheet = Project.Variables.params;
    sheet.Reset();
    while (!sheet.IsEOF()) {
      id = sheet.Value("ID");
      .
      .
      .
    }
    sheet.Disconnect();

    • rraghvani's avatar
      rraghvani
      Champion Level 3

      The snippet of coding does not really provide much information, to diagnose the issue. If you can provide the full code and the spreadsheet, that would help.

  • Here's the XLSx file.  I have replaced actual data with mock data.  There are 25 rows.

    params is the variable defined in the project


    Here's the complete code:

      const sheet = Project.Variables.params;

      sheet.Reset();
      while (!sheet.IsEOF()) {
        id = sheet.Value("ID");

        if (id == Project.TestItems.Current.Iteration) {
          obj = JSON.parse(sheet.Value("JSON"));
          break;
        }

        sheet.Next();
      }

      sheet.Disconnect();

    Please note that this is a very intermittent issue.

    • rraghvani's avatar
      rraghvani
      Champion Level 3

      I'm assuming you are using the Execution Plan? I ran 100 iterations (Count is 100) and no errors were shown.

      As you are opening and closing the Excel document many times, the internal object may not have been fully cleared. This could cause the issue.

      I'm not sure if you are doing data driven, but calling this snippet of code, will eventually slow things down. In this example, it will iterate 7 rows, then match the 8 row based on current iteration.

      • MadhuLambu's avatar
        MadhuLambu
        Contributor

        I haven't seen the issue often, but it does pop now and then and it causes the long running tests to stop. 

        Yes, this is data driven by matching the iteration number with the ID value. You are right about the slowness of the logic. Please do share your thoughts on better ways to do data driven.