Add submit_form method to agent and test case