Page 1 of 1

XML Knowledge - Useful for Ranorex?

Posted: Tue Aug 25, 2015 11:13 am
by Fergal
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!

Re: XML Knowledge - Useful for Ranorex?

Posted: Tue Aug 25, 2015 12:01 pm
by odklizec
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.

Re: XML Knowledge - Useful for Ranorex?

Posted: Tue Aug 25, 2015 1:50 pm
by krstcs
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.

Re: XML Knowledge - Useful for Ranorex?

Posted: Wed Aug 26, 2015 9:23 am
by Fergal
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!

Re: XML Knowledge - Useful for Ranorex?

Posted: Wed Aug 26, 2015 2:44 pm
by krstcs
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?

Re: XML Knowledge - Useful for Ranorex?

Posted: Thu Aug 27, 2015 2:22 pm
by Fergal
Thanks very much krstcs, that is most helpful and gives me a much clearer understanding of the tree structure.