Select an option in a dynamic select with codeception?
codeception
Solution
$option = $I->grabTextFrom('select option:nth-child(2)');
$I->selectOption("select", $option);
$I->click("Submit");
Problem
``` <select> <option value=''>-- Select an Option --</option> @foreach ($options as $option) <option value='{{ $option->value }}'>{{ $option->name }}</option> @endforeach </select> ``` Select the first dynamic option