Browser.html diffrent from the page source - watir-webdriver

Hi,

if I go to a page using watir-webdriver+ruby, and right click and view
source on firefox I see following code:

<a href="/mylink.html" class="my_links">Your home<span class="top
arrow"></span></a>

if I do browser.html in ruby it gives:
<a class="my_links" href="/mylink.html">Your home<span class="top
arrow"></span></a>

Why? and suppose I have input files which contains strings like:
<a href="/mylink.html" class="my_links">Your home<span class="top
arrow"></span></a>

I want to match with html source, but due to this problem it fails. Any
solution?

···

--
Posted via http://www.ruby-forum.com/.

If this is consistent it might just be the order in which watir is
processing the elements. You'd probably be best off making a check which
allows for the attributes to be in different orders, or sorts them
before checking for differences.

···

--
Posted via http://www.ruby-forum.com/.

Joel Pearson wrote in post #1086689:

If this is consistent it might just be the order in which watir is
processing the elements. You'd probably be best off making a check which
allows for the attributes to be in different orders, or sorts them
before checking for differences.

Thats a great solution, but isnt it costly? I guess there may be some
cheap solutions.

···

--
Posted via http://www.ruby-forum.com/\.