XML Knowledge - Useful for Ranorex?

Experiences, small talk, and other automation gossip.
Fergal
Certified Professional
Certified Professional
Posts: 298
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

XML Knowledge - Useful for Ranorex?

Post by Fergal » Tue Aug 25, 2015 11:13 am

Would having a basic knowledge of XML, be a useful skill to have when using Ranorex? E.g. would it give a stronger understanding of how the XPath works and how to use it more effectively?

Are there other skills, that you feel would be more useful than XML?

Thanks!

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: XML Knowledge - Useful for Ranorex?

Post by odklizec » Tue Aug 25, 2015 12:01 pm

Hi Fergal,

Any knowledge you can acquire is always good for you. You may never know when you will benefit from it ;) Soon or later you might need to read/write something from/to xml while creating automated tests. On the other hand, I don't think the XML knowledge is particularly helpful in the mission to learn and understand Ranorex xPaths.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: XML Knowledge - Useful for Ranorex?

Post by krstcs » Tue Aug 25, 2015 1:50 pm

For the most part, I would agree with Pavel that XML specifically won't help a lot with RanoreXPath.

However, understanding how XML (or any other markup language, such as HTML, WPF, etc.) is structured will help you understand why RanoreXPath works the way it does. Basically XPath views any application or web page as a tree of layered elements just like XML or HTML structures, even for Java or WinForms. This makes it easy to create a tree structure to describe the relationships of different elements to the root and to each other.
Shortcuts usually aren't...

Fergal
Certified Professional
Certified Professional
Posts: 298
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

Re: XML Knowledge - Useful for Ranorex?

Post by Fergal » Wed Aug 26, 2015 9:23 am

Thanks odklizec and krstcs for your helpful replies.
krstcs wrote:...tree of layered elements just like XML or HTML structures...
I have some knowledge of HTML but not sure I understand what you mean by "tree of layered elements", would it be possible to please explain it a little or perhaps link to a good reference? Is it related to nested tags?

Thanks again!

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: XML Knowledge - Useful for Ranorex?

Post by krstcs » Wed Aug 26, 2015 2:44 pm

So, XPath is just an easy way to express the relationship of one element to all of it's parents or children. When you see the whole structure it is like a tree, one root, many branches (folders) and leaves (elements). Hence a tree map structure.

XML and HTML are structured similarly, but they put children INSIDE parents. XPath just shows that as another step in the path.

Code: Select all

<HTML> <-- The root (the base /dom object in Ranorex Repo)
  <Body> <-- The trunk (rooted folder in Ranorex Repo)
    <Div> <-- A branch (rooted folder in Ranorex Repo)
      <Button /> <-- A leaf (element in Ranorex Repo)
    </Div>
    <Div>
      <Table />
    </Div>
  </Body>
</HTML>
The full XPath for the leaf here would be "/dom/body/div/button".

Does that help?
Shortcuts usually aren't...

Fergal
Certified Professional
Certified Professional
Posts: 298
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

Re: XML Knowledge - Useful for Ranorex?

Post by Fergal » Thu Aug 27, 2015 2:22 pm

Thanks very much krstcs, that is most helpful and gives me a much clearer understanding of the tree structure.