Pregunta

I want to get the value of an option which is selected using PHPUnit code. Do we have any function like the one below:

$this->byId('<selectname>')->selectValueBySelectedOption()

Is there any better way to do it?

¿Fue útil?

Solución

You could just manually fetch the option using CSS:

var $value = $this->byCssSelector("select#selectId > option[selected]")->getAttribute('value');
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top