Skip to content

Instantly share code, notes, and snippets.

@stmswitcher
Last active February 11, 2023 05:40
Show Gist options
  • Save stmswitcher/d77e8745b203ce1eb572 to your computer and use it in GitHub Desktop.
Save stmswitcher/d77e8745b203ce1eb572 to your computer and use it in GitHub Desktop.
Select random option for Codeception
$options = $I->grabMultiple('#selectID option', 'value');
$I->selectOption('select', $options[array_rand($options)]);
@ThatGuySam
Copy link

This just helped me a ton with selecting a random element

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment