How to SAVE a webform in Simpletest? I am able to save a sample webform in Simpletest if I only use title and body:

  $edit = array();
  $edit['title'] = 'Sample webform';
  $edit["body[$langcode][0][value]"] = $this-&gt;randomName();
  $this-&gt;drupalPost('node/add/webform', $edit, t('Save'));


But when it comes to add the additional fields,

$edit['customfield_xxx'] = '0053416';


the test fails:

Failed to set field customfield_xxx to 0053416


Is any nesting necessary to make it work?

UPDATE
It seems like after submitting the form as describe above I need to access the components page:
$this->drupalGet('node/1/webform/components');
where I build an array with all components. However I have been able to fill in the specific component form with 1 single field.
You need to mimics the user's behaviour.

You need to submit individually each form in multiple steps.

You must write correctly the field names (look for input names in the DOM with Firebug or Developer Tools)

  $edit = array();
  $edit['title'] = 'Sample webform';
  $edit["body[$langcode][0][value]"] = $this-&gt;randomName();
  $this-&gt;drupalPost('node/add/webform', $edit, t('Save'));


then submit the fields individually:

  $edit = array();
  $edit['add[name]'] = 'Sample webform';
  $edit['add[type]'] = 'textfield';//or whatever, optional
  $this-&gt;drupalPost('node/webforms/components', $edit, t('Add'));


Rinse and repeat.

You can create a custom function to perform that.