get pure html

Ask general questions here.
shinpa.you
Posts: 3
Joined: Thu May 16, 2019 10:17 am

get pure html

Post by shinpa.you » Thu May 16, 2019 10:35 am

Hi
how to get body's pure html source ?

i try to use getInnerHtml() to get html source ,but the result has been formatted,and with some random string(jQuery1557997886216="22") in the innerhtml.

ranorex:8.3.1

thanks

User avatar
RobinHood42
Posts: 324
Joined: Fri Jan 09, 2015 3:24 pm

Re: get pure html

Post by RobinHood42 » Fri May 17, 2019 12:19 pm

Most probably, your HTML source uses jQuery.?
You can view the HTML source in e.g. Chrome when right-clicking on your site and select view page source.
What if you compare the HTML with the one Ranorex generates? Did you try myDoc.GetHtml().ToString() ?

Cheers,
Robin

shinpa.you
Posts: 3
Joined: Thu May 16, 2019 10:17 am

Re: get pure html

Post by shinpa.you » Mon May 20, 2019 5:41 am

Thanks!

but i can find method GetHtml() in 8.3.1.
I want to confirm that the html source is the same before and after the modification.
should I only use screenshots ?

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

Re: get pure html

Post by odklizec » Mon May 20, 2019 8:24 am

Hi,

Have you tried to use it with DOM element? GetHtml should be available even in 8.3.1, but it's a webdocument-based method, so it cannot be used with particular web element. Anyway, you should really consider updating Ranorex with most recent 9.0.1 or, at very least, 8.3.3. There was a lot of bug fixes introduced between 8.3.1 and 9.0.1.
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

shinpa.you
Posts: 3
Joined: Thu May 16, 2019 10:17 am

Re: get pure html

Post by shinpa.you » Thu May 23, 2019 2:28 am

Thanks for your answer.
There are many elements on the page, it's too hard to check one by one.
so I want to compare the pure html.
I will try 9.0.1.