Forum Discussion

prabhakarkallam's avatar
prabhakarkallam
Occasional Contributor
8 years ago

unable to open Project suit file .pjs through command prompt

Hi,

    Iam trying to automate one sample application using testcomplete with c#.

    we have once java application,i need to access the controls and click and set text values,using automatedqa.script and      automatedqa.testcomplete connected application libraries for .net,please find the below give code

 

this is console application,i want to run through command prompt,but  iam getting error(can not create test complete),

 

if i run  this through .net no issue,but if i try to run the same application through command prompt,iam facing object error.

 

testcomplete working directory shows c:\windows\system32 and .net application shows correctly,i am not able to find the solution for this,please help me on this.

 

 

Connect.RunTest("TestProjectRefsLogs", "TestProjectRef", @"F:\latest_code_4-20-17\latest\Specflow\latest_code_tinyframework - latest\TinyFrameworkLibrary\TinyFrameworkLibrary\TestProjectRef\TestProjectRef.pjs");
System.Console.WriteLine("Tiny Framework is UP!!");
Thread.Sleep(2000);
workflowHost = Connect.Sys["Process"]("java");
if (workflowHost["Exists"])
{
PropArray = new AutomatedQA.script.var(new string[] { "JavaclassName" });
ValuesArray = new AutomatedQA.script.var(new string[] { "TouchTable" });
panel = workflowHost["Find"](PropArray, ValuesArray, 30000);
if (panel["Exists"])
{
panel["Click"]();
}
}

 

Regards,

Prabhakar k.

2 Replies

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    Hi Prabhakar,

     

    Just FYI, the Connected Apps libraries are deprecated and replaced by TestLeft. TestLeft provides strongly-typed .NET wrappers around the TestComplete engine, accessible using the regular C# syntax (no square brackets!), and there's no need to have a TestComplete project running at the same time.

     

    Using TestLeft, your code would look like this:

    using SmartBear.TestLeft;
    using SmartBear.TestLeft.TestObjects;
    using SmartBear.TestLeft.TestObjects.Swing;
    
    IWindow panel;
    Driver.Find<IProcess>(new ProcessPattern()
    {
        ProcessName = "java"
    }).TryFind<IWindow>(new AWTPattern()
    {
        JavaFullClassName = "*TouchTable"
    }, 30000, out panel);
    
    if (panel != null) {
      panel.Click();
    }

    We strongly recommend that users who are new to ConnectedApps consider using TestLeft instead.

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    It would be helpful to have the actual error message, even a screenshot would do.  "can not create test complete" is not recognizable.