Getting xdebug to work with BrowserTestBase functional tests?
BrowserTestBase and KernelTestBase use phpunit's 'run in separate process' feature which generates a new temporary php file from a template and then executes that. The output is provided as serialized php object which is then read back into the main thread an unserialized to yield the results.

So at present that makes using Xdebug fairly difficult.

We probably should open an issue to look at shipping our own template that support Xdebug.

In the meantime my suggestion would be to use outputting, you can use the standard approaches like var_export, print_r, echo etc or you can use $this-&gt;htmlOutput($something_you_need_to_debug); which then shows up amongst the other HTML output.

Then run your tests with -printer="\Drupal\Tests\Listeners\HtmlOutputPrinter"

This requires the BROWSERTEST_OUTPUT_DIRECTORY environment variable to be set, see core's phpunit.xml.dist for info on how to configure that.