Forum Discussion
Thank you. I will add this in the new feature thread.
Just noticed that even prototype function (JavaScript Project) as well not populated under the Routines list. JScript project prototype functions are listed.
Regards,
Saravana
Can you give an example of a prototype function in a JScript project that is showing in the drop down? I just did the following:
function testme() { function blah() { Log.Message('blah'); } this.me; this.who; this.whatever = function (){ Log.Message('what'); } }
And, as expected, only "testme" shows up in the drop down as that is a function that is declared globally on the unit.
- SaravanaKumar_N8 years agoContributor
- tristaanogre8 years agoEsteemed Contributor
Gotcha. Yep, seeing that.
Now, HKosova probably can give a more official response but, as I understand it, the routine drop down at the top of a script edit window is intended within the context of developing test cases as script. Each "routine" is, potentially, a test case and the idea is to give easy access to select such a test case and then click the "Run Current Routine" button.While in a full JavaScript IDE, those methods are "routines", they are not test cases or methods that can be run in such a manner... you need to instantiate the object and then run the routine. So, in the context of what TestComplete provides, this doesn't feel to me like it makes sense. That said, not sure why it works in JScript but not in JavaScript but, basically, that's how I experience it. I look forward to seeing the feature request as there might be some cool aspects about it concerning turning TC into something more of a full IDE.
Now, to your question about intellisense, etc... Creating classes and such and then having them available in what TC calls "code completion" would be cool. But keep in mind that, effectively, each script unit is being treated in the same way that a page is treated when using JavaScript for web development. You cannot call a routine or method or property of an object instantiated in a different web page unless you first import it into the web page or otherwise pass it through. So, in that line, TC is following that model. If you want an object to be available in Code completion, that object needs to be built in, somehow, to the environment either as a plugin or a Script Extension.- SaravanaKumar_N8 years agoContributor
Thank you for the valuable inputs.
I understood the routine list purpose. Then it would be good if we have something like tree structure of a Unit with its contents (like each functions) under Project Explorer as it would display in Eclipse IDE. Any solutions would be so helpful for us.
And yes, with JavaScript Class, I am able to export/import to another unit and can access its methods. Its working as expected.
Also these are core units files of the Project and we do not want to use as ScriptExtensions, since these are expected to change very often.
As you said Code completion is good with ScriptExtensions.
So as HKosova, I will put this in Features section. Hope Smartbear admins can come up with smart solution.
Many Thanks,
Saravana
Related Content
Recent Discussions
- 3 days agoMW_Didata