Select item from drop down (Month)

Hi! I have to select the previous month from a drop down. But my code seems incorrect.

image

And I’m using this code to get the previous month.

image

But I’m getting this error.

I’m getting the correct value which is June but I think it should be in upper to be selected. Can someone help me with this?

Thanks!

Ryt, Try by using upper
Date.now.Addmonths(-1).tostring(“MMMM”).ToUpper

1 Like

Sure, so your format MMMM is getting you June and July correctly because it is only getting 4 letters from the months. So you would not get September, but you would get Sept and so on. But Sept does not exist in your drop down so because of that you are getting an exception

Tried Date.now.Addmonths(-1).tostring(“MMMM”).ToUpper but I’m getting this error.

image

For testing just try to select itme by using Hardcoded “JUNE”
Then check is it working or not.

Tried hardcoding but still getting the error.

I think the select item is not working over there ,
Try to use click activity by clicking on one of the Month and then use variable in selectors

By review ur screen shot is there any option for type the month

Sir, tried using click. It would click JANUARY using this selector

image

But the same error message will pop up after

Open UiExplorer tree in that use aaname property where u will find the month name so u can use it in ur workflow
image

if still prob then

can u share ur workflow file??

Here’s my workflow.

Process.xaml (9.1 KB)

What is the website? Since you send us only with Attach Browser activity

The website is an internal system in our company

Okay, so you need to send us the screenshot of your selector when you are using Select Item Activity

Here’s my selector for that SELECT ITEM Activity

And here’s the error message I’m getting.

Based from the error message, it can get the value ‘June’ which is correct. I just have to make it uppercase so it matches the selection in the drop down. But when I do the Date.now.Addmonths(-1).tostring(“MMMM”).ToUpper, error message like this will pop

image

Process.xaml (9.2 KB)

can u try this again

Dude it worked! Thank you so much!

welcome Bro !!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.