Parametrise xmlcheckpoint name
I am looking to try and parameterise a function to check the xml generated against the baseline saved in TC.
i have simplified the code below, but my question is can i parameterise the actual checkpoint name, i.e. 'XML.XmlCheckpoint1' in the below? I can parameterise the actual xml source but i want to use this function multiple times in a loop, so want it to select the correct xml file from the Stores
procedure XML_Compare; var param1; param2; begin param1 := 'C:\\Work\\Data.xml'; param2 := Project.Variables.Driver.value('XMLCheckpointName'); XML.XmlCheckpoint1.Check(param1); end;
Solved! Go to Solution.
You're using DelphiScript so it's a bit trickier. Basically, you're going to want to use the "Evaluate" function
Evaluate('XML.' + CheckpointName + '.Check(param1)')
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Thank you Mysterious Gremlin Master 😉
DelphiScript is something i have inherited unfortunately, so thank you very much for your help.
That solved it for me.