c# - How select the gender in registration form by selenium 2.0? -
i want create bot, registrate accounts in gmail. have problem selecting month of birth. i'm programming on c# using selenium 2.0.
source code of "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 this:
var txtbirmon = driver.findelementbyid("month-label"); actions action = new actions(driver); action.clickandhold(txtbirmon).sendkeys(openqa.selenium.keys.enter);
first doing way:
txtbirmon.click(); txtbirmon.sendkeys(openqa.selenium.keys.arrowup); txtbirmon.sendkeys(openqa.selenium.keys.enter);
but it's not focusing on txtbirmon , scroll down page... doesn't work. doing wrong?
that's because you not perform
ing actions:
action.clickandhold(txtbirmon).sendkeys(openqa.selenium.keys.enter).perform();
Comments
Post a Comment