Forum Discussion

prekar's avatar
Occasional Contributor
4 years ago

Storing objects on separate file

Hi Everyone, I want to store all my object names in separate file which contain the NameMapping values and xpath values . How to do it in Testcomplete?
  • tphillips's avatar
    4 years ago

    If you are a glutton for punishment you could write a custom script that takes your file in and writes out a NameMapping.tcNM, but I don't see what the point would be.


    If you're using Javascript (or another scripting language) you could read in your separate file and use the eval() function to substitute in the correct NameMapping and xpath values.



    function ReadObjectFile(filename) {
        // read the file in here and return an object with your mapping
    all_objects = ReadObjectFile("path/to/file")
    button_object = all_objects["button4"]
    eval("Aliases.App.mainPage." + button_object).Click()