whitespaces are removed when saved page

29 views
Skip to first unread message

Egita Sidorova

unread,
Mar 27, 2013, 11:49:43 AM3/27/13
to seleniu...@googlegroups.com
whitespaces -trailing and preceeding are removed (php, selenium)
when selenium saves the page

i need to test that field has "   sss   ", but it is saved as "sss"

tried to use this guideline
but cannot figure out how to incorportate this ${space} into my code

here it mentions about the issue, but doesnt give the resolution

Egita Sidorova

unread,
Mar 27, 2013, 12:12:18 PM3/27/13
to seleniu...@googlegroups.com
well
maybe bit of the code helps
i have field that does accept whitespaces trailing and preceeding, named "ipmi_sensor"
i use as normally type() function
$this->type('ipmi_sensor', '   some name   ');

what ideally should happen is the name that is saved in database and also on the form for the 'ipmi_sensor' field should be '   some name  '
but it trims it and saves only 'some name'

Egita Sidorova

unread,
Mar 28, 2013, 6:21:50 AM3/28/13
to seleniu...@googlegroups.com
got solution, maybe others could use
javascript worked for me
first line sets the desired attribute value
second line retrieves same attribute value for further use
enjoy! :)

$this->getEval("this.browserbot.findElement('ipmi_sensor').value = '    asdf    ';");
var_dump($this->getEval("this.browserbot.findElement('ipmi_sensor').value;"));

On Wednesday, March 27, 2013 5:49:43 PM UTC+2, Egita Sidorova wrote:
Reply all
Reply to author
Forward
0 new messages