Restore Layout from getPageSource

Hello.
Is there any way to restore layout from PageSource XML?
I want to save XML and screenshot if my tests failed, but the only way i see is parsing XML to HTML. Do you know some libs or algorithms to do this?

You don’t say what language, but Nokogiri does this very well in Ruby.

Language does not matter. Nokogiri parse xml, but i want to convert “bounds=”[37,339][1043,465]"" from xml to css width and height, like Appium inspector do it.

Why not to borrow then the actual implementation from the inspector? It’s open source

I would be grateful if you could tell me the name of render method in appium-desktop project

Well, i found, that you use xmldom in [appium-inspector] project to convert source.
Can you add feature in appium to save snapshot (screenshot, layout and some data, like app, date, device and etc.) and restore it in inspector?

I personally don’t work on this project much (not a frontend developer myself). But you could create a feature request in its issues tracker.