I need to compare two elements whether they are in the desired order or
not. (which is coming first or which is on top)

You may also want to consider XPath expressions that use axes. For
example, if the two elements in question are 'a' elements, you could use
something like:

<td>
  assertElementPresent
</td>
<td>
  //a[text() = 'Second Link']/preceding::*/a[text() = 'First Link']
</td>

This would check for the existence of the first link provided that it
precedes the second link. You may also reverse the order and use the
following::* axis. Note that I haven't fully tested this, but it should
work.

For reference, check out examples of XPath axes at
http://www.zvon.org/xxl/XPathTutorial/General/examples.html

Cheers,
Mohammed
_______________________________________________
Selenium-users mailing list
Selenium-users@lists.public.thoughtworks.org
http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users

Reply via email to