DelphiScript runtime error on: .GetColumn('name').Index
Hi SM-TestComplete Community,
First of all, here are some general info:
---
TC language: DelphiScript
Testcomplete Version: 14.20.2175.7 x64
OS: MS WIN 10 Pro 64-bit
The AUT (Desktop) is built in Delphi 7.
---
The object UT is a grid (inherited from TCustomGrid) and we want to get the column index like .GetColumn('name').Index + 1.
1. As we run the single script, it doesn't raise any exception, it works well.
The single script is of course one of a more complex test project.
2. But when we run the whole project then we got (see attached *.jpg) this DelphiScript runtime error Exception.
3. But this is further to consider: when we call exactly the same script in another TC-project in order to perform the foreseen actions (on the exactly same grid), in this case it doesn't raise any runtime exception. This is the main aspect we wish to clear.
The AUT (Desktop) is exactly the same.
In the attached file (*.jpg) you can see some more details of the our DelphiScript and runtime error.
Many thanks in advance and have a nice day
Best regards
Antonini E.
I attached the same picture, maybe it is now better to see.
The error text is: "An Exception occurred: 0xC0000096; class: ; description: ".
<So, a copy/paste of your code snippet would be helpful.>
-- START SNIPPET
procedure einenBeliebigenMandantenLoeschenAberNichtDenDemoDatenMandanten();
var
i, mandantenAnzahl, ColumnVerzeichnisIndex: Integer;
lVerzeichnis: String;
const
MAX_ANZAHL_MANDANTEN = 15;
begin
lVerzeichnis := ProjectSuite.Variables.DemoDatenMandantenPfad;
if NOT Aliases.Lohn.FMandantenanlage.Exists then
begin
Aliases.Lohn.FSMenu.MDIClient.Keys('~fm');
end;
Aliases.Lohn.FMandantenanlage.Maximize;
Aliases.Lohn.FMandantenanlage.Panel1.NO_1.TS_Mandanten.GR_Mandant.Keys('^[Home]');
mandantenAnzahl := Aliases.Lohn.FMandantenanlage.Panel1.NO_1.TS_Mandanten.GR_Mandant.RowCounter;
ColumnVerzeichnisIndex := Aliases.Lohn.FMandantenanlage.Panel1.NO_1.TS_Mandanten.GR_Mandant.GetColumn('Pfad').Index + 1;-- END
Thank you.
E.A.