0
votes

I am pretty new to Selenium and using Selenium IDE for my automation. I get stuck at one point. Basically, there is a "selectMonth" drop down in the calendar control which I need to open it. Following is the HTML Code:

"<"select class="ui-datepicker-month" data-event="change" data-handler="selectMonth" style="background-color: rgb(255, 255, 255);"> //Please ignore the inverted commas besides (select), it doesn't allow simple select tag)

<option value="0">

    Jan

</option>
<option value="1">

    Feb

</option>
<option value="2">

    Mar

</option>
<option value="3">

    Apr

</option>
<option value="4">

    May

</option>
<option value="5">

    Jun

</option>
<option selected="selected" value="6">

    Jul

</option>

<"/select> //Please ignore the inverted commas besides (select), it doesn't allow simple select tag)

I am using following commands but it doesn't work. However, when I click on "Find" button on Selenium IDE, it does highlight the element in yellow. Not sure what I am missing over here.

Command: click Target: //html/body/div[3]/div/div/select[1] // This is through xPath

Command: click Target: css=select.ui-datepicker-month

Any help would be appreciated. See the attached screen shot for the reference.

3
Could anybody please provide any input on this? I tried my best to crack this out but unfortunately it didn't work. I have been struggling due to this and not able to move forward. Please Please help me. Thanks. - nimeshp27

3 Answers

0
votes

Try command clickAt, not click, I think it should work

0
votes

I'm trying to figure out how to activate the dropdown for this type of calendar month/year element. But I do have a partial answer for you.

You must use the "select" command to select a value from this dropdown.

Command: select Target: css=.ui-datepicker-year Value: 2015
(or whichever year you want to select)

Command: select Target: css=.ui-datepicker-month Value: Jan (or whichever month you want to select, use strings as they appear in the list)

For a better set of steps to try

  1. Go to http://jqueryui.com/datepicker/#dropdown-month-year

  2. Change the right side option to "Display month & year menus"

  3. Click the date box to open the calendar

  4. Use

    click | .ui-datepicker-month

*** this doesn't work to activate the month dropdown list (someone else mentioned that javascript may be needed to perform this function)

  1. Use

    select | .ui-datepicker-month | Feb

This does work to select the month of February, even though the dropdown is not open.

0
votes

Command : select
Target : class=ui-datepicker-month
Value : label=Jan

From this You can Select "Jan" month in calender after open calender. You can change month as per your requirement.