Get a page's HTML in a Drupal browser test

Submitted by timmillwood on Tue, 05/12/2017 - 16:55

Debugging tests can often be a pain, but using this snippet it's possible to get the HTML of a page when using BrowserTestBase.

$this->getSession()->getPage()->getHtml();

Add new comment