Forum Discussion

wmtan01's avatar
wmtan01
Contributor
4 years ago
Solved

Converting an old project to CSS/XPATH

Hi,

 

It seems most of the updates of TestComplete are geared toward Cross Platform Testing which is great. But my question is how do you convert an old project namemapping to the one that uses CSS/XPATH as its identifiers? 

 

I've been looking around at the config and the namemapping itself but I can't seem to pinpoint how to do it. We have a massive project since we've been using the app for 5 years now but with everything moving to CSS/XPATH I want to update the project to be more robust. Any ideas on how to do it? Or would I have to start from scratch again (that would definitely suck)

  • hkim5's avatar
    hkim5
    4 years ago

    the converter is available in 14.72 - the official documentation has not gone up yet

     

    What is it
    A simple conversion utility to help users convert their Namemapping file from proprietary object recognition format to cross-platform object recognition format (XPath and CSS Selectors). This will help users run
    tests created prior to v14.40 on CBT. Our internal tests suggests that ~70% of conversion happens automatically.
    How it works
    There are two phases of conversion:
    Data collection phase - TestComplete needs to analyze information in your Namemapping file and create new mapping criteria during runtime. You will need run your existing project several times so that TestComplete reads and understands as much information as possible.
    Conversion phase- After TestComplete get generates the required files, it applies the new criteria to your existing project
     
    Instructions
    1. Make sure to back up your entire project
    2. Launch TestComplete using a special command line key - -SaveNameMappingData:"<Directory_to_store_namemapping_data>"
    3. Run you test several times so all test cases are executed and all objects are interacted with
    4. Close TestComplete and restart TestComplete without the special command line key
    5. Go to Namemapping panel, right-click to bring up the context menu, and select “Convert Namemapping” 
       
      Select all the files that were generated in the “data collection” phase and click OK
    6. Your objects will now be in the cross-platform format (XPath and CSS Selectors)

18 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Any ideas on how to do it?

    I see no other way but manual update.

    Just because I don't believe that automatic conversion from 'classic' NameMapping identifiers to cross-platform XPath/CSS can be easy and reliable.

     

    • wmtan01's avatar
      wmtan01
      Contributor

      When you say manual, I can update my current namemapping to include xpath/css selectors without remapping objects? I couldn't find that option in my namemapping

      • hkim5's avatar
        hkim5
        Staff

        currently, the only way is to "start from scratch" (as in you cannot just select xpath or css as an identification property and have it work (each of the new objects mapped using the xpath/css method is essentially saving a combination of conditional findelement("whatever") as their identification properties (so its completely different)

        ----

        the team (to my knowledge) is working on a namemapping converter, and I can try to get a timeline as well.