Currently, I am utilizing Selenium in combination with Mink to automate the registration process on several of our websites.
In order to proceed with the registration, it is necessary to select your birth date from three different drop-down menus. My approach involves using the select-option method along with the XPath of the select field and the desired option value.
While this method functions properly in both Firefox and Chrome, I have encountered an issue with Safari. On certain pages, the selection process works as intended, yet on others, nothing happens. Strangely, there are no exceptions thrown; the script simply fails to interact with the select fields, resulting in a failed registration.
The structure of the select fields' CSS is as follows:
<select name="Signup:Birthday[day]" size="1" class=" date_day" id="Birthday">
<option value="" selected="selected">---</option>
<option value="1">01</option>
<option value="2">02</option>
<option value="3">03</option>
.......
</select>
Even though I am employing the xpath //*[@id="Birthday"]
along with option 3
, Safari seems unresponsive.
public function selectState($option, $name) {
$page = $this->getSession()->getPage();
$selectElement = $page->find('xpath', '//*[@id="Birthday"]');
$selectElement->selectOption($option);
}
Any suggestions or insights?