"Failed to set field" Problem with SimpleTest, testing a form With SimpleTests, I want to test a form similar to :

  // Textfield :
  $form['fieldset_name']['test'] = array(
    '#type' =&gt; 'textfield',
    ...
  );
  // Submit :
  $form['fieldset_name']['submit_button'] = array(
    '#type' =&gt; 'submit',
    '#submit' =&gt; array('my_module_form_submit'),
    '#value' =&gt; 'Submit button',
  );


This form is accessed from 'admin/config/my_module'. So I add the following test in my_module.test :

  function testForm() {
    $path = 'admin/config/my_module';
    $edit['test'] = 'testing field\'s input';
    $this-&gt;drupalPost($path, $edit, t('Submit button'));
  }


When I run the test, it fails with these errors :


  Failed to set field test to testing field\'s input
  
  Found the Add button (failed)


Where am I wrong ?
Permissions would be my first guess.

Enable debug output in the Simpletest settings and then check if your module is installed and you have permissions to visit that page.