0

I'm working with headless chrome as a Webdriver for selenium tests in JAVA. I suspect that the DOM changes when i work with the headless version of chrome. Is there any way to get a copy of the DOM of html during the test?

  • 1
    what is the usecase ? – cruisepandey May 07 '18 at 14:44
  • Possible duplicate of [Selenium for Python: How to dump current page's HTML](https://stackoverflow.com/questions/49618287/selenium-for-python-how-to-dump-current-pages-html) – undetected Selenium May 07 '18 at 15:03
  • I locate elements in my test by Xpath, when i work with headless chrome the elements are found in the DOM but when i give an xpath of 3 elements for example [Editor]//[Panel]//[Button] it doesn't work. Which means the order of the elements in the DOM changes. – Saad Hamouine May 08 '18 at 08:32

1 Answers1

0

You can try

driver.getPageSource()

I had a similar problem with PhantomJS and this revealed that the DOM is in fact different than on a regular browser.

StopTheRain
  • 367
  • 1
  • 5
  • 15