Page 1 of 1

how to create snapshot file using script

Posted: Tue Aug 17, 2010 3:47 pm
by hobli
Hi,

sometimes, I would like to scan through an object element tree for certain element, and then trying to create a snapshot file (*.rxnp) file using script, is there any function I can use to create such a file?

thanks a lot

I am using Ranorex 2.3.2

Re: how to create snapshot file using script

Posted: Tue Aug 17, 2010 4:21 pm
by Ciege
Got this snippet from support a few months ago:

Code: Select all

Ranorex.Core.ElementSnapshot snap = Ranorex.Core.ElementSnapshot.Capture(element, true);   
System.IO.File.WriteAllText("fileName.rxsnp", snap.SerializeXml());  

Re: how to create snapshot file using script

Posted: Wed Aug 18, 2010 10:38 am
by hobli
Hi, Ranorex team,

excellent solution and response!

thanks a lot, it works perfectly!