diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php
index 667f705..3f94db8 100644
--- a/core/modules/simpletest/src/WebTestBase.php
+++ b/core/modules/simpletest/src/WebTestBase.php
@@ -1586,6 +1586,8 @@ protected function drupalPostForm($path, $edit, $submit, array $options = array(
     $ajax = is_array($submit);
     if (isset($path)) {
       $this->drupalGet($path, $options);
+    } else {
+      $path = $this->getUrl();
     }
 
     if ($this->parse()) {
