Storing objects on separate file
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2020
02:50 PM
10-26-2020
02:50 PM
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?
Solved! Go to Solution.
2 REPLIES 2
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2020
05:17 PM
10-26-2020
05:17 PM
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2020
01:20 AM
10-29-2020
01:20 AM
