Forum Discussion

mfoster711's avatar
mfoster711
Regular Contributor
2 years ago

Which scripting language did you pick and why

Which scripting language did you pick for Testcomplete and why?

 

We have been using Testcomplete for 10+ years and we chose vbscript originally because it was most similar to the language our previous tool used and would be easiest for the transition.  After 10+ years our code base really needs to be cleaned up and moderized. I plan to hire a new developer and have him work on cleaning up the code and possibly switching to a new scripting language. 

 

I am thinking about using python because it seems to be a common language that most new hires are familiar with. Also, we might start using Selenium for some testing and we would be using python with it so I was thinking it would be easier to use python in both. That being said, I feel javascript or vbscript offer more functionality in TestComplete. Just not sure which to choose. I am mainly conisdering sticking with vbscript or switching to python or javascript. I would love to hear other opinions on this.

 

 

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    VBScript has two main disadvantages for me: absence of optional function parameters and absence of (normal) exception handling (try/catch/finally).

    From this point of view, DelphiScript is my preference.

    However, in real life, I would vote for JScript. But JScript does not support out function parameters. This limits possibility to make Win API calls that use out parameters and sometimes forces you to return structures like json or dictionary from functions. But the advantage is that JScript supports json (which is quite often convenient) and provides access to native string/date/regexp functionality.

     

    I am afraid of Python because it has no means to restore code logic when for this or that reason code indentation is lost. (Do not say it will not be lost, the only question is when it will be lost 🙂 )

     

    JavaScript looks strange to me because this is essentially asynchronous language that for some strange reason became popular for testing, where all actions are synchronous. TestComplete internally forces JavaScript to execute synchronously, so no big difference from JScript here, but for other environments (Selenium etc.) I got tired to see every line of code to be prefixed by statements like 'async await'. I understand that modern computers are powerful, but this does not explain me the internal logic of use of async language and forcing it to be synchronous.

     

    There are several other minor points, but in my personal rating for now JScript is first one, than goes DelphiScript with everything else on the third place.

     

    They say that Python has a lot of libraries for, say, network, ML, AI, etc. support. But will you need this for your tests?