Call to undefined function drupal_execute()
drupal_execute hasn't existed since Drupal 6.

In Drupal 8 you can submit a form programatically like this augmented example from ProgrammaticTest::submitForm:

$values = ['foo' =&gt; 'bar'];

// Programmatically submit the given values.
$form_state = (new FormState())-&gt;setValues($values);
\Drupal::formBuilder()-&gt;submitForm('\Drupal\form_test\Form\FormTestProgrammaticForm', $form_state);