SimpleTest: How to make multiple Ajax posts and then save the data?
On subsequent tests of a form that has already been loaded and posted, this call will submit the form to the same URL with the field values resulting from any previous activity:

$this-&gt;drupalPost(NULL, NULL, t('Save'));


The $edit argument is only to submit new field values. And, passing NULL for $path uses the currently loaded page. So, to test my AJAX button that adds items to the form:

$this-&gt;drupalGet('path/to/my/form');
$this-&gt;drupalPostAJAX(NULL, NULL, array('op' =&gt; 'Add Item Button'));
$this-&gt;drupalPostAJAX(NULL, NULL, array('op' =&gt; 'Add Item Button'));
$this-&gt;drupalPost(NULL, NULL, t('Save'));


I was able to verify after this that two items had been added to the form as expected.