문제

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?

도움이 되었습니까?

해결책

You could just manually fetch the option using CSS:

var $value = $this->byCssSelector("select#selectId > option[selected]")->getAttribute('value');
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top