Forum Discussion

Karthik_gowda's avatar
Karthik_gowda
Occasional Contributor
4 months ago

Choosing programming language

Hi everyone,  we have a requirement to automate the desktop application that is built on cobol framework , I am in a dilemma to choose the programming language that is either Javascript or python, b...
  • AlexKaras's avatar
    3 months ago

    Hi,

     

    This is my opinion:

    TestComplete supports four scripting languages: VBScript, DelphiScript, JScript and JavaScript. C#Script and C++Script are essentially JScript with C#/C++-compatible syntax.

    All these scripting languages provide absolutely the same functionality in the meaning of testing with TestComplete (i.e. they behave absolutely identical when looking for a tested UI object and performing actions over it).

    There is a popular idea that automated tests must be created using the same language as the tested application. While this makes sense for unit-testing, I do not remember a case when this was of some value for high-level end-to-end tests. (And you do not do unit testing with TestComplete as this is senseless.)

    Summary: All scripting languages supported by TestComplete has identical testing functionality.

    VBScript has extremely poor and inconvenient error handling functionality. This is the main reason of why I avoid to recommend it.

    DelphiScript was a good option for many years until its error handling was either broken or started to be handled in a different way in TestComplete. Also it might appear to be not easy to port certain code samples from other languages to DelphiScript.

    My biggest concern about Python is that its code structure is based on indents only and it does not provide any means to restore code logic/code flow. I.e. if you stringify Python code, there are no means to restore it to the previous state. The only option is to re-create code logic a-new. One such case was more than enough for me personally to begin avoid Python.

    JScript does not allow to return more than one value from a function and one must apply code workarounds if there is a need to pass some object to a function by value but not by reference. To return more than one value from a function one must return some structure (json for example) and this is not always convenient.

    Summarizing: there is no big difference as for what scripting language to use in your test project in TestComplete, choose whatever you are most comfortable with. Testing functionality will be the same. (But remember, that it is not possible to mix scripting languages - test project can use only one scripting language.)

     

    P.S. Your automation lead is correct about not using NameMapping. Aliases, that are based on NameMapping should be used instead. (Aliases are on top of NameMapping and NameMapping is on top of your tested application and serves as a translation table between physical UI structure of your tested application and logical UI structure that you create using Aliases.) Aliases are already a flavor of Page Object model but with a more extended functionality. Just remember that one should not rely on automatic namemapping functionality in TestComplete. The recommended approach is to manually create convenient, performant and reliable Aliases skeleton of the tested application and then, using this skeleton as a base, use FindXXX methods to search for UI elements that cannot be reliably namemapped.