Forum Discussion

heidi_n's avatar
heidi_n
Regular Contributor
8 years ago

How to tell which Programming Language was selected when a Keyword Test was originally created?

I have a collection of old keyword tests and I would like to convert some of them to script, but for some of them, Delphi was selected in the Keyword Test Test Creation Wizard and for some of them, JavaScript was selected. How do I tell what was selected on these old tests?

  • dmiscannon's avatar
    dmiscannon
    8 years ago

    To see what programming language was selected for the Project Suite when it was created,

    * Right Click on the Project Suite name in the Project Workspace

    * Select Source Control and then Configure

    * Select General and then Project. The default language for the Project Suite is listed under Default Language

     

     

     

     

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    With regards to keyword tests, only if you are using Code Expressions in parameters or if you have Code Snippets in your keyword test does the original language make a difference.  Within the keyword test, for an operation that contains a code expression parameter or for a code snippet, there is a segment of the XML that looks like this:

    LangId="{9E432E59-33EF-4EAA-95C6-63FC35AF69EE}

    This is the indicator of what language the code is used for.  It's not clear, just from this, what language this is.  So... while you can tell that there is a language originally used for these, I'm not certain how easy it is to determine the specifics of the language.

    • dmiscannon's avatar
      dmiscannon
      Frequent Contributor

      To see what programming language was selected for the Project Suite when it was created,

      * Right Click on the Project Suite name in the Project Workspace

      * Select Source Control and then Configure

      * Select General and then Project. The default language for the Project Suite is listed under Default Language

       

       

       

       

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        dmiscannon wrote:

        To see what programming language was selected for the Project Suite when it was created,

        * Right Click on the Project Suite name in the Project Workspace

        * Select Source Control and then Configure

        * Select General and then Project. The default language for the Project Suite is listed under Default Language

         

         


        That will give the default language for creating new projects... but it does not guarentee that the project you are working in is that language.  I could set my default language to JavaScript (which I have) but still can create projects in JScript or VBScript (which I have).

    • heidi_n's avatar
      heidi_n
      Regular Contributor

      We are not using coded parameters or code snippets. If Delphi was originally chosen for a keyword test (but I didn't actually "code" anything), then I converted the keyword test to scripted and wanted to use JavaScript, would that be a problem?

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Your process for that would be:

         

        1) Create a JavaScript project (language is chosen on the project level, not at the keyword test level)

        2) Add your Keyword test to the JavaScript project (Right click, select Add -> Existing item)

        3) Right click on the keyword test and select "convert to script".

         

        This will convert the keyword test to a script function utilizing the language syntax from the parent project.  If, on step 1, you had selected VBScript for the language of your project, then any conversions of the keyword tests would be to VBScript because that's the project's parent language.