Forum Discussion

MaheshBhoite's avatar
MaheshBhoite
Occasional Contributor
8 years ago

TestComplete VBScript to Python script conversion

We have a TestComplete project running using VBScript, our management has decided to explore Python as scripting language. How should I approach converting the vbs script files to python files?

Is there any short way of doing it or do I have to convert function by function?

3 Replies

  • baxatob's avatar
    baxatob
    Community Hero

    No short way. You need to go step by step - it is the safest way. However you can use some features to make this process a little bit easier. E.g. you can use Ctrl-H to replace/remove redundant symbols.

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    No short way as it was said already.

    I participated in different projects for different customers and found that it helps if you try to use TestComplete's functionality / functions as many as you can instead of using script language-specific ones. The more TestComplete objects and functions is used in your code, the more migration from language to language becomes a task of plain syntax adjustment and you don't have a problem to figure-out how to implement some language-specific features using some other language.

    Obviously, if you are working for a very long and dedicated test project, you may benefit if you use language specifics for your test code. But this significantly decreases code portability.

    • mgroen2's avatar
      mgroen2
      Super Contributor

      MaheshBhoite

      Haven't tried it, but thinking a bit 'out of the box', I thought of this scenario;

      1. install a second testcomplete version (could go for  a trial edition);

      2. play (execute) the VBScript tests on the machine on TestComplete;

      3. record actions in second (installed at step 1) TestComplete version ('record actions from screen');

      4. after test execution, convert the recorded actions in step 3 to Python

       

      I am sure this won't work for all actions but you might want to give it a shot...