phpunit-selenium icon indicating copy to clipboard operation
phpunit-selenium copied to clipboard

value() appends instead of replacing

Open florinutz opened this issue 12 years ago • 3 comments

//some input with default value 13: $blocks = $this->elements($this->using('css selector')->value('.product')); $block = $blocks[$order]; $quantityInput = $block->element($this->using('css selector')->value('.quantity input'))

$initialValue = $quantityInput->value(); //13

$quantityInput->value(4);

$wrongValue = $quantityInput->value(); //134

florinutz avatar Oct 18 '12 14:10 florinutz

This is to be expected, as the parameter to value() is a sequence of key strokes to send to the element (for example you could send a Down Arrow or a Return. I documented this and added it to the API docs.

giorgiosironi avatar Oct 21 '12 13:10 giorgiosironi

how to clean up the field?

nekulin avatar Oct 30 '12 12:10 nekulin

$this->using('css selector')->clear(); $this->using('css selector')->value('.product')

Eating method which allows you to perform just 2 steps?

nekulin avatar Oct 30 '12 12:10 nekulin