Hi,
in Ranorex Spy it is possible to save an element an all its childs (including all attributes) as snapshotfile in XML Format. Can you do the same using the C# API?
thx,
Bernhard
Save snapshot as XML via C# API
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Save snapshot as XML via C# API
Hello Bernhard,
There is a method named Snapshot() which can be used in order to create a Ranorex Snapshot file using API.
For example:
Regards,
Bernhard
There is a method named Snapshot() which can be used in order to create a Ranorex Snapshot file using API.
For example:
public static void Snapshot( Element target )Please take a look in our "Online API Documentation".
Regards,
Bernhard
Re: Save snapshot as XML via C# API
thx for your reply. that helped.
but i have another question:
whenever i save a snapshot (independent if I use ranorex spy or the api method SerializeXml()), the XML gets pretty printed like that:
as a result of this, whenever i access the values of the XML they contain leading and trailing whitespaces because other programms interpret the value as something like:
is it possible to save the snapshot without the extra whitespaces or do I have to get rid of them myself?
thanks,
bernhard
but i have another question:
whenever i save a snapshot (independent if I use ranorex spy or the api method SerializeXml()), the XML gets pretty printed like that:
Code: Select all
<attribute
name="windowtext"
type="System.String">
Calculator
</Attribute>
Code: Select all
<tag>\n
\t\tvalue\n
</tag>
thanks,
bernhard
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Save snapshot as XML via C# API
Hello Bernhard,
Unfortunately this is not possible out of the box.
I am afraid that you have to change it in the already created snapshot.
Regards,
Bernhard
Unfortunately this is not possible out of the box.
I am afraid that you have to change it in the already created snapshot.
Regards,
Bernhard