Active
Project:
Selenium to SimpleTest
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Jun 2010 at 23:45 UTC
Updated:
14 Jun 2010 at 21:52 UTC
The names of the fields used in drupalGet() and drupalPost() don't come out right.
Selenium gives the following phpUnit output:
$this->type("edit-name", "Field Example Node");
$this->type("edit-type", "field_example_node");
$this->click("edit-submit");
and this module should turn that into:
$edit = array('name' => t('Field Example Node'), 'type' => 'field_example_node');
$this->drupalPost(NULL, $edit, t('Submit');
but instead it turns it into
$edit = array (
'edit-name' => 'Field Example Node',
'edit-type' => 'field_example_node',
);
$this->drupalPost(NULL, $edit, t('edit-submit'));
It's using the id instead of the name field... which is what phpUnit is giving it. But anyway, it doesn't work.
Comments
Comment #1
rfaySo Selenium IDE doesn't even notice/use the "value" attribute of a button.
There are only two things that drupalPost() can use: The value field of the button, or the name of the form.
So it would be impossible for Selenium to Simpletest to ever submit a form, right?
Comment #2
rfayComment #3
boombatower commentedWell if we have the ID we can lookup the form ID or submit value.
Comment #4
rfayRemember, we're doing a conversion after the fact, without a reference to the page. So if *all we have* is the ID, we're hosed, true? We don't have the page any more, just the phpunit code that Selenium output for us.
AFAICT, there is no way one could ever submit a form just using generated code through this process. Please tell me I'm wrong.
Comment #5
boombatower commentedWe should be able to, since we have to see the page in order to submit it during run time. Just need to split up the drupalPost() into something like the following:
Comment #6
rfayExcellent! That will work.