Select Current Month from a Drop Down Menu

image
Hello, I am trying to select the current month from the drop-down list,
I used an assigned activity: Current_Month=today.ToString(“MMMM”)
Then I tried to use select item activity and put as input the current month, did not work so I altered the selector with an aaname to make it dynamic still not working any help?

@Farah_halawani
Welcome to the forum

Dropdowns can occur in different variations (select/option, textfield/datalist / webkits) which is also to check more in detail when select item is not working.

A common workaround is a 2 click action

  • 1st click - expand the dropdown
  • 2nd click - click on otem with a dynamic selector

whenever i try to select one exact month in the click activity the whole table of months gets selected what should i do

Hi @Farah_halawani, if there is disabled input field next to calendar you can use Set Text activity and check the AlterIfDisabled property to true

Thanks.

what do you mean by disabled input field next to calendar

just go with us step by step

try to model it with the 2 click approach
when this is not working then share with us the details (e.g. Uiexplorer, Browser F12 Webtools) about the dropdown

For sure: when the URL is public do not miss to share it with us

The first click is used to open all the options, and the second one is to select the current month, unfortunately, i cannot share the link.
First whenever I try to alter the selector on one month it does not work check the second photo
Screenshot (3)

@Farah_halawani

never miss out to analyze elements in detail as we mentioned:

we would recommend to do a right click on the expanded drop down and select “inspect element” to invoke the Browser tools

can you share with us the selector of the wrongly full box selecting click activity?

Kindly note: the generated display name of second click shows Select - often a hint that a selector needs a manually correction and get pointed to the option (item)

The assign activity:
image

and the selector:

better you can share with as mentioned the details from the Html/UiElement Structures around the option and the select element. Thanks

Ensure that the Tablerow will not have a bad impact to the selector and check also for alternate selector strategies (once you shared details as mentioned above with us, we can have a look on it as well)

Hi @Farah_halawani ,

I would like you to try First Find Children activity, If that works then you can use Select Item (If select tag is present in the Ui element).

Please inspect the element in browser, Provide the snap if possible.

Thanks,

the children activity worked,
image
here s the inspection

image

you see the surrounding spaces on the month names?

so combine the wildcards with the month name for the second click

innertext='*{{Current_Month}}*'

I changed the selector of the second click as you suggested:
image

And here is the workflow still not choosing the right current month

on option element we do, not on select element

ok on the first click i have to use the innertext suggested. but what should i do on the second click when it opens all the list ?

it is just opening the list of months

take a breath and don’t rush. Look at the task with a little distance.

In the options, the month names are surrounded by spaces. But the select item clicked only with the month name alone and did not find the value (no match).

One of many possibilities is now in the dynamic selector for the 2nd click to enclose the month name with wildcards.

1 Like

Need to take tableRow out of that, also.