diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php
index e4e9622..1df3386 100644
--- a/core/modules/simpletest/src/WebTestBase.php
+++ b/core/modules/simpletest/src/WebTestBase.php
@@ -1587,6 +1587,9 @@ protected function drupalPostForm($path, $edit, $submit, array $options = array(
     if (isset($path)) {
       $this->drupalGet($path, $options);
     }
+    else {
+      $path = $this->getUrl();
+    }
 
     if ($this->parse()) {
       $edit_save = $edit;
