Contributions
Consuming a WCF Web Service
Hi, I don't have any trouble consuming an ASP.NET Web Service from TestComplete, but I have had no luck consuming a WCF Web Service. I'm able to create the reference in TestComplete and get a listing of available methods in the WebService, but I get an exception when trying to call any of those methods. Is there any way to get this to work? Known issues?11KViews0likes1CommentNon-visual objects in Windows Service
Hi, I'm usually able to obtain a reference to a non-visual object by using a static field, property or method, which I can access through the AppDomain(…).dotNET statement. This looks like this: Sys.Process("MyApp").AppDomain("MyApp.exe").dotNET.namespace_name.class_name.property_name However, when dealing with a windows service (installed by executing "installutil MyApp.exe"), AppDomain("MyApp.exe") doesn't appear to exist, although Sys.Process("MyApp") does. Can TestComplete be used to obtain references to non-visual objects of a windows service?10KViews0likes1CommentRe: New behavior for JScript Object prototype property
I believe I have finally narrowed it down, and it appears the answer to my problem lies in your first comment about code in different units. I have included an example below to illustrate this. My extension of Array with a new method, and the usage of this method, are both located in Unit1. If I create the array in Unit1 and use the method "contains", then everything is OK. On the other hand, if I create the array in Unit2, as below, then I get an exception. An array created in Unit2 is an array not extended with the method "contains". But since this worked before, I'm thinking maybe there has been a change in how arrays are handled when "passed between units". Is there any way I can recreate/clone the array created in Unit2 in Unit1, and this way have it be an array with the method "contains". Or do I have to include "Array.prototype.contains = ..." in Unit2 as well? -- Unit1 -- ----------- //USEUNIT Unit2 Array.prototype.contains = function(element) { for (var i=0; i<this["length"]; i++) { if (this == element) { return true; } } return false; }; function Main() { try { var myArray = CreateArray(); myArray["contains"](2); } catch(exception) { Log["Error"]("Exception", exception["description"]); } } -- Unit2 -- ----------- function CreateArray() { var a = new Array(); a["push"](1); a["push"](2); a["push"](3); return a; }2.3KViews0likes0CommentsRe: New behavior for JScript Object prototype property
Thank you for your reply. I have experienced what you just described about what happens when the code resides in different units. In this case however, the code where new methods are added to arrays, numbers and strings is located in the same file as the code using these. It used to work, but not anymore, even though nothing has been modified in my script.2.3KViews0likes0CommentsNew behavior for JScript Object prototype property
When using TestComplete 7.20, I extended arrays, numbers and strings with new functionality as shown in the following. Array.prototype.contains = function(element) { for (var i=0; i<this["length"]; i++) { if (this == element) { return true; } } return false; }; Number.prototype.toFixed = function(precision) { var power = Math["pow"](10, precision || 0); return String(Math["round"](this * power) / power); }; String.prototype.repeat = function(n) { return new Array(n + 1)["join"](this); }; This worked well. However, now that I'm using TestComplete 7.52, I keep getting exceptions stating: Microsoft JScript runtime error Object doesn't support this property or method I use C#Script, but as I understand it, this uses an underlying JScript engine. My questions is this. Has any changes been made that would prevent me from extending arrays, numbers and strings with new methods? Will this be a no no, from now on? This worked fine before. It would be great if anyone could shed some light on the matter.22KViews0likes15Comments"Select Test" dialog in "Organize Tests" no longer lists new script files
All of a sudden, when I open up the "Select Test" dialog from "Organize Tests", newly added script files are no longer listed. I have tested deleting script files and recreating them, but the result is the same. If I remove an older script file which is listed in the "Select Test" dialog and then recreate the file using "Script > Add > New Item...", the script file and its methods are no longer listed. I am using TestComplete Enterprise 7.20.12KViews0likes1Comment- 2.4KViews0likes0Comments