Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Select an option in a dynamic select with codeception?

Tags:

codeception

<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

like image 920
Michael J. Calkins Avatar asked Jul 01 '13 21:07

Michael J. Calkins


1 Answers

$option = $I->grabTextFrom('select option:nth-child(2)');
$I->selectOption("select", $option);
$I->click("Submit");
like image 130
Michael J. Calkins Avatar answered Oct 30 '22 03:10

Michael J. Calkins