how to create snapshot file using script : Automation API

how to create snapshot file using script

Class library usage, coding and language questions.

how to create snapshot file using script

Postby hobli » Tue Aug 17, 2010 4: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
hobli
 
Posts: 57
Joined: Thu Jul 30, 2009 2:15 am

Re: how to create snapshot file using script

Postby Ciege » Tue Aug 17, 2010 5: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...
User avatar
Ciege
 
Posts: 965
Joined: Thu Oct 16, 2008 7:46 pm
Location: Arizona, USA

Re: how to create snapshot file using script

Postby hobli » Wed Aug 18, 2010 11:38 am

Hi, Ranorex team,

excellent solution and response!

thanks a lot, it works perfectly!
hobli
 
Posts: 57
Joined: Thu Jul 30, 2009 2:15 am


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests