I want to create a bot, which will be registrate accounts in gmail. I have problem with selecting the month of birth. I'm programming on C# using Selenium 2.0.
Source code of this "complicated" part.
<legend><strong id="BirthdayLabel">Birthday</strong></legend>
<label id="month-label" class="month">
<span aria-invalid="true" class=" form-error" id="BirthMonth"><div aria-activedescendant=":0" title="Birthday" aria-haspopup="true" tabindex="0" aria-expanded="false" style="-moz-user-select: none;" role="listbox" class="goog-inline-block goog-flat-menu-button jfk-select"><div aria-posinset="0" aria-setsize="12" role="option" id=":0" class="goog-inline-block goog-flat-menu-button-caption">Month</div><div aria-hidden="true" class="goog-inline-block goog-flat-menu-button-dropdown"> </div></div><input id="HiddenBirthMonth" name="BirthMonth" type="hidden"></span>
</label>
I do it like this:
var txtBirMon = Driver.FindElementById("month-label");
Actions action = new Actions(Driver);
action.ClickAndHold(txtBirMon).SendKeys(OpenQA.Selenium.Keys.Enter);
First I doing it another way:
txtBirMon.Click();
txtBirMon.SendKeys(OpenQA.Selenium.Keys.ArrowUp);
txtBirMon.SendKeys(OpenQA.Selenium.Keys.Enter);
But it's not focusing on txtBirMon and just scroll down the page... But it doesn't work. What I doing wrong?