Support the ongoing development of Laravel.io →
Forms Testing
Last updated 3 years ago.
0

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.

Last updated 10 years ago.
0

Dot notation definitely does not work. It complains about an undefined variable comment.

0

Running into this same issue. Ever find a solution?

0

Same issue

0

Sign in to participate in this thread!

Eventy

Your banner here too?

EdRands edrands Joined 3 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.