Forum Discussion

ZJ's avatar
ZJ
Occasional Visitor
3 months ago

VBScript feature will be removed from windows

Hello, we noticed an announcement form Microsoft about VBScript feature will be removed from Windows after year 2027.

Because we are using TC with VBScript, so I have 3 questions need your help:

1: Does TC still support VBScript If VBscript feature removed from Windows?

2: Is there any smart way or convenient way to convert VBscripts to Python via TC?

3: If we partially convert VBscripts to Python, is it ok if we mixed 2 languages to implement same functionality as before? If Yes, is there any reference link?

Thank you!  

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    VBScript has been around for 27 years, and due to security vulnerabilities, VBScript will be deprecated in future releases of Windows. 

    It's best to choose a supported language that TestComplete supports, either JavaScript or Python. Plus it's worth checking to see if there are any limitations in the supported languages. You will have to manually convert your scripts, and it's not possible to use different languages within the same project.

     

    • JDR2500's avatar
      JDR2500
      Frequent Contributor

      Hey, you're going to hurt VBScipt's feelings.  Python is no spring chicken.  It's been around for 30+ years.

      In any event, just because Windows is dropping VBScript support doesn't necessarily mean TestComplete has to follow suit, unless there are dependencies on Microsoft components.  I'm not sure if that's the case.

      Still, I wouldn't panic if I were you.  If you start new projects you can select Python or Java as the scripting language.  However, I anticipate you'll still be able to use your VBScript based projects for the foreseeable future.

  • I don't know if there is a TestComplete tool that will do this for you, but chatGPT works great for tasks like this. All you have to do is say,

    'Hi ChatGPT, I would like to convert the following script from VBScript into a Python script: "<codehere>" '.

    I'm pretty sure ChatGPT also knows about TestComplete, so you could add info about TestComplete like so:

    'Hi ChatGPT, I wrote some code in TestComplete using VBScript. Because VBScript is being discontinued in 2027, I would like to convert the VBScripts into Python scripts. Here are all the functions/methods I've written in VBScript. Can you please convert these to Python for me?  Here is the code: "<codehere>" '.

    Once you get a reply from ChatGPT, If you would like it to write one of the python generated functions in a different way, you can reply to chat like so: "Hi Chat, thank you for all the conversions. I would like to improve on the conversion you did of function, <function name>. The function, <function name>, could be made better by using the testcomplete functionality aqString (or whatever you would like it to change). Can we improve this by implementing these changes?" ...

    and then just continue the conversation with ChatGPT until everything looks the way you want it to look. Yes, you will have to manually copy the VBScript code from each file and then paste it into chatGPT, but it cuts down on the amount of time tremendously. Try Copy and Paste multiple functions into ChatGPT ... I wouldn't worry ... I'm pretty sure ChatGPT can handle having multiple VBScripts handed to it at once and will return a conversion for each one.

    To your question #3: As far as I know, you are only allowed to use one scripting language per project. I am pretty sure that if you have multiple projects within the same suite, then project-a within the suite does Not have to use the same scripting language as project-b. 

  • Hassan_Ballan's avatar
    Hassan_Ballan
    Frequent Contributor

    Hello, to answer your questions No, No, and No.

    When you create TestComplete project you chose the language and you can not change it afterwards. You need to create new project (default language JavaScript) and chose the language to individually convert (ChatGPT is good at that) and add your scripts one at a time.