Not sure, but try dot notation maybe?
$this->type('foo', 'comment.0.name')
EDIT: Whatever you provide as element, its validity is checked via CrawlerTrait\filterByNameOrId()
method, which is:
protected function filterByNameOrId($name, $element = '*')
{
$name = str_replace('#', '', $name);
return $this->crawler->filter("{$element}#{$name}, {$element}[name='{$name}']");
}
Just make sure whatever name you pass to it, it turns out to be valid filter, especially valid XPath context, because underlying Symfony FormFilter class supports XPath.
Dot notation definitely does not work. It complains about an undefined variable comment
.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community