Ask a Question

Storing objects on separate file

SOLVED
prekar
Occasional Contributor

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?

2 REPLIES 2
tphillips
Frequent Contributor

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.

e.g.

 

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()

 


--------------------
Senior SQA Automation Engineer
sonya_m
SmartBear Alumni (Retired)

Great job tphillips! 

 

@prekar does this help?


Sonya Mihaljova
Community and Education Specialist

cancel
Showing results for 
Search instead for 
Did you mean: