Odin Technology - Automated Software Testing

Axe Test Automation Platform

General discussion relating to the Axe Test Automation Platform from Odin Technology

Posts by Odin employees marked:

XML templating and mapping

Hi Sam

I'm looking at a proof of concept for a new project which involves creating XML files to submit via a portal.

I know how to create XML templates with tokenised elements as per the AXE help examples, eg

<NewDataSet>
 <User>
  <Name>%Name%</Name>
  <Email>%Email%</Email>
 </User>
</NewDataSet>
 
My questions are as follows:

1. How best to create a template which supports multiple groups of elements, ie in the example above, how can the template be created to support a variable number of users in a subtest?

2. In subtest files, how can you map data to (for example) the second, third, fourth instance of <Name> without actually mapping multiple instances of Name in an object map as Name1, Name2, Name3 etc (which would then result in having multiple columns in the subtest?)

Your help on this is much appreciated

Thanks

Mark
Mark Winspear Send private email
Thursday, November 22, 2012
 
 
Sorry - further information... Axe 3.4, Selenium (1) with C#
Mark Winspear Send private email
Thursday, November 22, 2012
 
 
Hi Mark,

Both of these are achievable and have been used in Axe Harness projects in the past.

1. The best way to do this is to tokenize the fragments themselves. i.e. have an object declared in Axe for each dynamic section, build that up, then add it to the master. e.g.

<NewDataSet>
 <User>
  <Name>%Name%</Name>
  <Email>%Email%</Email>
  %ADDRESS%
 </User>
</NewDataSet>

Where %ADDRESS% is substituted by a fragment that is itself tokenized:
 <Address>
  <Street>%Street%</Street>
  <Town>%Town%</Town>
 </Address>

2. Use standard xpath to get the required instance. Then you can specify the instance as a parameter e.g. in a custom get action. See this forum post for more details:
http://fogbugz.odin.co.uk/default.asp?axe.1.56808.2

Sam
Sam Warwick Send private email
Thursday, November 22, 2012
 
 
Thanks Sam

Do you have a working example of (1)?  I'm not entirely sure how to implement this using a template file and a subtest file

Re (2).  I'm not sure how to code the function - this would seem like a fairly common function - would you be able to advise the function details and include in the standard action map for new releases?

The axe harness function get(instance) seems to work ok when combined with a val function, but when using substitution a get(instance);set seems to set the data to all tokenised elements of that type (eg all %id% are set to 100) so I'm not sure of the best way to do this.

Additionally, subtest loads the template file.  The first instance of each object needs a value assigned then the file is saved. Does that mean a new subtest is required for the setting of every instance? Just working out the most efficient way of doing this

I'll send a modified version of the AxeHarness tests to demonstrate as it's tricky to word.

Thanks

Mark
Mark Winspear Send private email
Friday, November 23, 2012
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics