Andreja,
I looked at the code you attached and, unfortunately, it's difficult to say what can cause the error.
Does the wizard you are testing function properly? I am asking because of the following code --
...
Aliases.PaymentsClient_A.BankImportWizard.WizardFrame1.cxGroupBox1.cxButton1.ClickButton();
//Click Next when Transforming is 100%, it waits for cca 8 minutes
for (d=1; Aliases.PaymentsClient_A.BankImportWizard.FrameWizardBottom1.pnlButtons.btnNext.Enabled == false; d++){
...
If the wizard does not change the Enabled property by the time when the script engine comes to the "for" line, then the waiting loop does not work and your script goes directly to the next script statement (that clicks another button). This situation may be causing problems, so I suggest inserting a short delay after ClickButton:
...
Aliases.PaymentsClient_A.BankImportWizard.WizardFrame1.cxGroupBox1.cxButton1.ClickButton();
aqUtils.Delay(500);
...
If this does not help, please contact the SmartBear Support Team:
http://smartbear.com/support/message/?prod=TestComplete
Please include your test project files along with a description of the problem: run your tests, reproduce the problem, then pack the test project along with test log files and attach the resulting archive. The test log data will help the guys identify problematic script lines.
One more note:
You use a loop to wait until the Enabled property becomes true. A simpler option is to use the WaitProperty method. You could try the following code:
...
Aliases.PaymentsClient_A.BankImportWizard.WizardFrame1.cxGroupBox1.cxButton1.ClickButton();
aqUtils.Delay(500);
if (Aliases.PaymentsClient_A.BankImportWizard.FrameWizardBottom1.pnlButtons.btnNext.WaitProperty("Enabled", true, 500000) == false)
{
// Error!
...