Forum Discussion
- AlexKaras
Champion Level 3
Hi Ashok,
Actually, NameMapping file is an xml one.
Or you can craft your own xml file with the structure you need and use it in your projects. - makh_dvOccasional ContributorHi Ashok,
Why do you need this? What issue do you want to resolve?
I have an xslt that transforms nameMapping.tcnm into a bit more simple xml.
Here is it:
http://namemapping2objects.codeplex.com/SourceControl/changeset/view/11386#261899 - gentleseaFrequent ContributorHow do I apply the XSLT? Is there a program for doing this?
- makh_dvOccasional ContributorUsually I use MS Visual Studio any editions.
For small NameMapping you can try here:
http://markbucayan.appspot.com/xslt/index.html
If you have huge name mapping try any free tool, or use some coding.
Like EditX or anything google will answer "Xslt processor free" :-) - anatar02ContributorHello all,
Thanks for your valuable reply :)
Alexei Karas-
Could you please help me to create our own Object-repository in xml format. would great, if you provide some sample Object-repository xml for me to understand. - gentleseaFrequent ContributorI applied the XSLT using EditiX and the resulting file is about 1/10th of the size of the original. But it does not work anymore. Is there manual work necessary after the XSLT conversion?
- makh_dvOccasional ContributorErnst,
Can you describe what you are trying to do?
TestComplete is able to work only with original XML nameMapping, "tcnm" format.
And xslt just provides a representation in different format, this is just an example to initial tread. And can be used by other tools.
If you are trying to make your own Object Mapping approach using custom xml, so probably I've directed you in wrong way.
Because I used that xml with other tool, non TestComplete.
The easiest way to have "custom NameMapping" is using object wrappers in a kind of PageObject pattern.
On the simple example of Notepad can look like following:
function NotepadWrapper()
{
this.getEditBox = function()
{
return Sys.Process("notepad").Window("Notepad", "*", 1).Window("Edit", "", 1);
}
this.sendEditKeys = function(keys)
{
this.getEditBox().Keys(keys);
return this;
}
this.setEditValue = function(value)
{
this.getEditBox().wText = value;
return this;
}
this.verifyEdit = function(expectedValue)
{
aqObject.CompareProperty(this.getEditBox().wText, cmpEqual, expectedValue, false);
return this;
}
}
//usage
function dummyTest()
{
var notepad = new NotepadWrapper();
notepad
.setEditValue("bla-bla Test")
.verifyEdit("bla-bla Test")
.sendEditKeys("begin from ")
.verifyEdit("begin from bla-bla Test");
}
and if you want to store "Sys.Process("notepad").Window("Notepad", "*", 1).Window("Edit", "", 1);" this info in xml, you are probably free to select the format, I haven't seen good and flexible solutions for this, because all of this is wrapped by NameMapping/Alias functionality.
Imho NameMapping is really good here. and you can replace this hard to read getter return to "return Alias.Notepad.Edit";
P.S. please, someone suggest me, how can I wrap code examples in more tidy view in this forum :-) - gentleseaFrequent ContributorDmytro, I thought your script would shrink the NameMapping. I just tried it out of curiosity. I am fine like this also. No worries. To wrap code, use
- AlexKaras
Champion Level 3
Hi Ernst,
> I thought your script would shrink the NameMapping.
You may check the Name Mapping | Store Code Completion information property for your project (available via right click on the project node, then Edit | Properties) and set it to None.