bharat_kumar-ga
10 years agoNew Contributor
WaitWindow in connected applications is not working!!
Hello,
'WaitWindow' method is not working visual studio 2013 C# code. In the below code, I was expecting the system to wait for 40 seconds before saying that the window is not found. But it took only 6 seconds to execute the test!
I have tried to execute very similar C# script in TestComplete 10 and it works fine.
I am new to connected applications. Please let me know if I am missing something very obvious!
//===============================================
// C# Code in Visual Studio
//===============================================
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using AutomatedQA.TestComplete;
using AutomatedQA.script;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SmartAutomation
{
[TestClass]
public class AutomatedTest : Connect
{
[TestMethod]
public void Test3()
{
Console.WriteLine(DateTime.Now.ToString() + " :: Test started");
var TestObject;
string WndClass = "*";
string WndCaption = "Unavailable Window";
int WaitTimeInMilliSeconds = 40000;
TestObject = Sys["Process"]("IceDesktop")["WaitWindow"](WndClass, WndCaption, -1, WaitTimeInMilliSeconds);
if (TestObject["Exists"])
{
Console.WriteLine(DateTime.Now.ToString() + " :: Window found");
}
else
{
Console.WriteLine(DateTime.Now.ToString() + " :: Window not found");
}
}
}
}
//===============================================
// Output in Visual Studio 2013
//===============================================
Test Name: Test3
Test Outcome: Passed
Result StandardOutput:
17/06/2014 15:14:10 :: Test started
17/06/2014 15:14:15 :: Window not found
//===============================================
// C# script in TestComplete 10
//===============================================
function Test()
{
Log.Message("Test started");
var TestObject;
var WndClass = "*";
var WndCaption = "Unavailable Window";
var WaitTimeInMilliSeconds = 40000;
TestObject = Sys["Process"]("IceDesktop")["WaitWindow"](WndClass, WndCaption, -1, WaitTimeInMilliSeconds);
if (TestObject["Exists"])
{
Log.Message("Window found");
}
else
{
Log.Message("Window is not found");
}
}
//===============================================
// Output in TestComplete 10
//===============================================
Test started 15:22:57 Normal
Window is not found 15:23:37 Normal
Refer to the attached doc for more screenshots.
Cheers,
Bharat
'WaitWindow' method is not working visual studio 2013 C# code. In the below code, I was expecting the system to wait for 40 seconds before saying that the window is not found. But it took only 6 seconds to execute the test!
I have tried to execute very similar C# script in TestComplete 10 and it works fine.
I am new to connected applications. Please let me know if I am missing something very obvious!
//===============================================
// C# Code in Visual Studio
//===============================================
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using AutomatedQA.TestComplete;
using AutomatedQA.script;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SmartAutomation
{
[TestClass]
public class AutomatedTest : Connect
{
[TestMethod]
public void Test3()
{
Console.WriteLine(DateTime.Now.ToString() + " :: Test started");
var TestObject;
string WndClass = "*";
string WndCaption = "Unavailable Window";
int WaitTimeInMilliSeconds = 40000;
TestObject = Sys["Process"]("IceDesktop")["WaitWindow"](WndClass, WndCaption, -1, WaitTimeInMilliSeconds);
if (TestObject["Exists"])
{
Console.WriteLine(DateTime.Now.ToString() + " :: Window found");
}
else
{
Console.WriteLine(DateTime.Now.ToString() + " :: Window not found");
}
}
}
}
//===============================================
// Output in Visual Studio 2013
//===============================================
Test Name: Test3
Test Outcome: Passed
Result StandardOutput:
17/06/2014 15:14:10 :: Test started
17/06/2014 15:14:15 :: Window not found
//===============================================
// C# script in TestComplete 10
//===============================================
function Test()
{
Log.Message("Test started");
var TestObject;
var WndClass = "*";
var WndCaption = "Unavailable Window";
var WaitTimeInMilliSeconds = 40000;
TestObject = Sys["Process"]("IceDesktop")["WaitWindow"](WndClass, WndCaption, -1, WaitTimeInMilliSeconds);
if (TestObject["Exists"])
{
Log.Message("Window found");
}
else
{
Log.Message("Window is not found");
}
}
//===============================================
// Output in TestComplete 10
//===============================================
Test started 15:22:57 Normal
Window is not found 15:23:37 Normal
Refer to the attached doc for more screenshots.
Cheers,
Bharat