Forum Discussion
Hi Tanya,
Thanks for looking into this.
We are using TestComplete 10.0.531.7
I will check this with TestComplete 10.30.1145 and get back to you.
And sorry, I am not trying to handle a hanging/frozen application. But it is very similar. I have to wait for the application to fetch data from different systems and show that data in a seperate window. This is a bit time consuming activity and I dont want to give fixed wait time to delay the script.
So I tried to use the WaitWindow method with some good amount of wait time as below.
TestObject = Sys["Process"]("ProcessName")["WaitWindow"]("*", "Window Caption", -1, 60000);
This above line works fine in TestComplete 10.0.531.7 but not in the Visual Studio!
Actually in Visual Studio, the system searches for that window for a maximum of 3 seconds and then returns a stub object if the window is not available. If the window is available within that 3 seconds it is returning the window object.
This means that the WaitWindow is working but waits for only 3 seconds or so!!
But anyway, I have slightly modified my code to achieve what I was trying to do. This works fine but I think it is not quite right!!
Console.WriteLine(DateTime.Now.ToString() + " :: Test started");
var TestObject;
string WndClass = "*";
string WndCaption = "Information";
int WaitTimeInMilliSeconds = 60000;
int i = 0;
while (true)
{
i = i + 1;
TestObject = Sys["Process"]("IceDesktop")["WaitWindow"](WndClass, WndCaption, -1, 1000);
if (TestObject["Exists"])
{
Console.WriteLine(DateTime.Now.ToString() + " :: Window found");
break;
}
if (i >= WaitTimeInMilliSeconds/1000)
{
break;
}
}
if (TestObject["Exists"])
{
//do what is required to do on that window
}
else
{
Console.WriteLine(DateTime.Now.ToString() + " :: Window not found");
}
Thanks,
Bharat
Related Content
- 3 years agoIuliaVascan
- 3 years agomsalvador
- 2 years agoletoged
Recent Discussions
- 26 minutes agodhundley