I want to choose a drop-down option based on its text,what should i do? This is my Html code :
<select name="category">
<option>Appliances</option>
<option>Sporting Goods</option>
<option>Cosmetics</option>
</select>
And this is my selector in dusk :
->select('category','Appliances')
You can use XPath:
$selector = "//select[@name='category']/option[text()='Appliances']";
$browser->driver->findElement(WebDriverBy::xpath($selector))->click();