Forum Discussion

olivier1's avatar
olivier1
New Contributor
8 years ago

"Automatic conversion of the code snippet... may corrupt the code" when opening a project suite

Hello,
I have a project suite in TestComplete.
We started with v10, and now we have version 12. We use v12 from 6 months with no problem.
I recently added a new project test in the project suite, and added existing scripts and keyword tests to it.

Now, when I open the project suite, I always have 4-5 warnings about code snippets in keyword tests, for example:
"Run Code Snippet" Operation
Automatic conversion of the code snippet to another scripting language may corrupt the code. Please check the code snippet manually.
Project: 2 Diagnostic
Keyword Test: OuvertureHorizonCPF
Code snippet: Sys.Desktop.KeyDown(VK_CONTROL);

For information, the language used in our project tests is JavaScript.

TIA!

Olivier

  • OK, I found the problem:
    - Projects were created with JScript
    - Someone changed the default language with JavaScript, in Tools -> Options
    - I then created a new project, and added existing keyword tests (coded with JScript)
    Then I always had the 4-5 warnings when opening the project suite, even after changing the default language to JScript, in Tools -> Options

    I have edited the MDS file of the new project, and changed the "config language" parameter:
    It was JavaScript in it: config language="{90F89436-9452-4F95-9882-6B5210079F13}"
    And I changed it with JScript: config language="{E42909F2-4390-4F5D-94B8-FABF59BABFCE}"

    No more warnings!
    Thank you for your support!

  • olivier1's avatar
    olivier1
    New Contributor

    OK, I found the problem:
    - Projects were created with JScript
    - Someone changed the default language with JavaScript, in Tools -> Options
    - I then created a new project, and added existing keyword tests (coded with JScript)
    Then I always had the 4-5 warnings when opening the project suite, even after changing the default language to JScript, in Tools -> Options

    I have edited the MDS file of the new project, and changed the "config language" parameter:
    It was JavaScript in it: config language="{90F89436-9452-4F95-9882-6B5210079F13}"
    And I changed it with JScript: config language="{E42909F2-4390-4F5D-94B8-FABF59BABFCE}"

    No more warnings!
    Thank you for your support!

  • Check in Tools -> Options and see if your default language got changed accidentally.

     

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      If you're adding existing keyword tests from a TC 10 project into a TC 12 project, they need to be converted.  JavaScript was only added in TC 11 so any code snippets you had in TC 10 were most likely JScript so TC 12 needs to do conversion.  That's where the problem is.