cancel
Showing results for 
Search instead for 
Did you mean: 

Syntax.CreateInvoke no longer creates "Run Script Routine" for Keyword Test

rickm
Contributor

Syntax.CreateInvoke no longer creates "Run Script Routine" for Keyword Test

I have a number of Script Extensions that I wrote over 7 years ago. Sometime in the last year or so the record actions no longer work properly, in that the syntax that is created no longer uses "Run Script Routine" and instead tries to invoke my function directly.

Here is a sample of my code:

 

// Generate the set code
function CreateSetSyntax(ldName, name, value)
{
  // Generate the treeHelp set call by calling the layoutDesignerSetValue script
  var call;
  call = Syntax.CreateInvoke();
  call.ClassValue = "LayoutDesignerFunctions";
  call.InvokeName = "layoutDesignerSetValue";
  call.IsProperty = false;
  call.AddParameter(ldName);
  call.AddParameter(name);
  call.AddParameter(value);

  return call;
}

...

// Generate code for the set method
      var syntax = CreateSetSyntax(ldName, name, value);

...

// Insert the generated code into the recorded script
      Recorder.AddSyntaxToScript(syntax); 
      // Or:
      Recorder.AddTextToScript(Syntax.GenerateSource(syntax));  


Both Recorder.AddSyntaxToScript() and Recorder.AddTextToScript() seem to do the same thing so I've used the first form all these years.

Until recently the above inserted the following into my Keyword Test at record time:

Run Script Routine    LayoutDesignerFunctions - layoutDesignerSetValue    "Aliases.StripLog.LayoutForm", "Track=Curve Track 1|Layer=Eng. Data|Property=Constrain to Grid", "False"

but now it creates:

LayoutDesignerFunctions    layoutDesignerSetValue    "Aliases.StripLog.LayoutForm", "Track=Curve Track 1|Layer=Eng. Data|Property=Constrain to Grid", "False"

I don't mind changing my code if necessary, but I can't find how to fix this. Or did it get broken when they resurrected record-time script extensions awhile ago?

2 REPLIES 2
rickm
Contributor

Re: Syntax.CreateInvoke no longer creates "Run Script Routine" for Keyword Test

I forgot to mention that I was running 12.42 (I think) when I noticed this failure. I updated today to the latest 12.60 and the problem is still there.

AlexKaras
Community Hero

Re: Syntax.CreateInvoke no longer creates "Run Script Routine" for Keyword Test

Hi,

 

I think that contacting Support directly via https://support.smartbear.com/message/?prod=TestComplete form might be the fastest way for your case...

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors