how to create snapshot file using script

Class library usage, coding and language questions.
hobli
Posts: 57
Joined: Thu Jul 30, 2009 1:15 am

how to create snapshot file using script

Post by hobli » Tue Aug 17, 2010 3:47 pm

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

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: how to create snapshot file using script

Post by Ciege » Tue Aug 17, 2010 4:21 pm

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());  
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

hobli
Posts: 57
Joined: Thu Jul 30, 2009 1:15 am

Re: how to create snapshot file using script

Post by hobli » Wed Aug 18, 2010 10:38 am

Hi, Ranorex team,

excellent solution and response!

thanks a lot, it works perfectly!