Forum Discussion
HKosova
Alumni
14 years agoHi Sudhir,
* Right-click your project suite in Project Explorer and select Edit > Variables from the context menu.
* Note down the name, type and default value of the variable in the Temporary Variables table. Then, delete this variable.
* Right-click the Persistent Variables table, select New Item from the context menu and create a variable with the same name, type and default value.
Now, the variable will keep the value assigned during the previous test run.
You can increase the timeout within which TestComplete is waiting for objects to appear using the Tools > Current Project Properties > Playback > Auto-wait timeout, ms option. The default value of 10 sec seems to be insufficient for your tested app. For heavy .NET applications, we recommend setting this option to at least 60000 ms (that is, 60 sec).
My Application takes time to get vsisible when we invoke it.That is why its giving the error because it might try to perform action defined in routine 2.
I guess, your variable is defined as temporary, that's why, it doesn't preserve values between test runs. To use it in the scenario you described, you'll need to redefine the variable as persistent. To do this:
I mean I have defined it in first line of script.In second line i am calling this variable.
If I Run the first line by selecting > Run Selected option it runs successfully.
But then If I run the second line > Run Selected option it doen not recall the variable.
Is this mean the variable is temporary for the Single Run ?
* Right-click your project suite in Project Explorer and select Edit > Variables from the context menu.
* Note down the name, type and default value of the variable in the Temporary Variables table. Then, delete this variable.
* Right-click the Persistent Variables table, select New Item from the context menu and create a variable with the same name, type and default value.
Now, the variable will keep the value assigned during the previous test run.
By the way, I'd recommend using the specialized OpenFile method to automate the Open File dialog, e.g.:
//Enters text in the text editor.
Aliases.QBIS.dlgOpen.ComboBoxEx32.SetText(WB);
//Aliases.QBIS.dlgOpen.DUIViewWndClassName.DirectUIHWND.FloatNotifySink.ComboBox.Edit.SetText(WB);
//Simulates a left-button single click in a window or control as specified (relative position, shift keys).
Aliases.QBIS.dlgOpen.btnOpen.ClickButton();
The Open File dialog has different GUI implementations in different Windows versions, and the OpenFile method is specially designed to help you avoid possible playback issues caused by these differences.