How to automate date picker with week inside the date picker?

Hi,

I have an activity to automate a date picker based on inputted from excel as seen below :

image

I have iterate the date from excel into data table and the inputted months and year are correct. The problem is on when selecting the date, take a look at the screenshot below :

image

The number on the very left 19-24 (from top to below) reference weeks. And the rest are just normal date, when I inputted a date between 19-24 may my selector is not working and it shows an error “Multiple Similar Matches Found”.

I iterate the date by manipulating the column and the row value based on the HTML tag. There are 2 different calendar dates to be selected by the selector. Date 1 is selected and the row + column value are equal as the HTML inspected with UI Explorer, date 2 isn’t working and the row + column value are not same as date 1 (assuming date 1 and 2 are at same date)

I tried to create 2 different sequence for each date (each sequence has its own variable inside the scope) and its not working.

I tried to change the flow to only 1 sequence with 1 variable and still not working.

I tried to set 1 variable and set it to global and still not working too.

Any help on this kind of problem? @Palaniyappan or any1 maybe can help me with this? Thanks !

Hi,

Can you try the following steps?

First, create DateTime variable from the string :

dateVar = CDate("23 May 2022")

Then

CInt(dateVar.DayOfWeek)

returns weekday number such as Sunday is 0, Monday is 1 etc. We can use it as ColumnIndex.

And

(dateVar.Day+New DateTime(dateVar.Year,dateVar.Month,1).DayOfWeek-1) \ 7

returns week number of the month: for example 1 May 2022 is 0, 23 May 2022 is 3.
So we can use it as RowIndex.

As a result, we can strictly indicate element using above both index. Please use not fuzzy but strict selector.

Regards,

Hi sorry I didnt give clear details. I will give u the details about my html element.

So I inspect with UI explorer.

  1. Week is column 1, so the column is :
    Sunday Column 2
    Monday Column 3
    .
    .
    .
    Saturday is Column 8

  2. Sunday until Saturday row start is row 4, so the row is :
    Week 1 : Row 4
    Week 2 : Row 5
    .
    .
    .
    Week 4 Row 8

And can you share the workflow if possible to make? I’m not familiar if explained theory. Thanks !!

Hi,

As I cannot access the calendar, the following is a mock sample. Hope this helps you.

colIndex = 2+CInt(dateVar.DayOfWeek)
rowIndex = 4+((dateVar.Day+New DateTime(dateVar.Year,dateVar.Month,1).DayOfWeek-1) \ 7)
strDay = dateVar.Day.ToString

Sequence3.xaml (80.1 KB)

Please see also document of dynamic selectors.

Regards,

1 Like

Thanks for your responses. I will mark it as solution once I execute it

Alternative solution is to use regex to skip matching the first column:

<webctrl innerText='{{dateNumber}}' tableRow='[4-8]' tableCol='[2-8]' matching:tableRow='regex' matching:tableCol='regex' />

Hi,

I think we need to indicate the element using strict row and column in this case, because there is possibility to indicate wrong element such as case of 30 April 2022 as the following image if use range.

image

Regards,

1 Like

Yes, @Yoichi you are correct! I tested on a date picker without duplicates so dates for the next month eluded me.

image

Hi @Yoichi I just tried the solution u give, and somehow it’s still not working. This is the output of the write line and the value are equal when I inspect with UI Explorer :

image

the error is still the same (Multiple similar matches found)

image

I tried 2 ways. Set variable for each date (UAD has its own scope, Received has its own scope) and set 1 variable for both 2 dates. The selector never click the date.

and my uipath has no strict selector, it only have selector and fuzzy selector

Is this some kind of UIPath bug or what? Maybe there’s a logical answer for this selector for not clicking the date? Thanks

Update on this, I try to input 21 may 2022 in the selector, and somehow the output of the index is 28 may based on the row and column value?

This is the write line of 21 may
image

This is the UI Explorer value of 28 may

image

Hi, thanks for your help.

I havent tried your solution yet due to deadline. I will let u know further more

Hi,

and my UiPath has no strict selector, it only have selector and fuzzy selector

Selector is renamed StrictSelector in the latest version. If you use older version, just Selector will work. Can you try as the following?

Turn on Selector and turn off Fuzzy and Image at TargetMethod property.
Then edit selector to dynamic at Selector or StrictSelector property.

Regards,

It’s still not working, the error is now couldn’t the the UI Element. Is the target and anchor giving impact? This is my target and anchor

image

Hi,

In this case, we don’t need to set Anchor. Can you try to remove information for Anchor, then run again?

Regards,

Hi,

I tried this too and the selector won’t do anything at all. This is the properties

image

and below is the properties of the strict selector

Hi,

To isolate cause, can you try the following steps?

First, remove aaname and add proper tag attribute (get from UiExplore etc)

Next, set default value to row_index_uad and col_index_uad, as the following.

Then press Validate button in the top-left of the dialog.

If it turns green, turn on Highlight button and check it indicates an element you expect. Next add aaname attribute and check it works again.

If it turns red, there may be problem regarding other selector attribute. So need to review it.

Regards,

It turns red.

When I check the Override default value and validate, it goes red and the “Checked Override” is unchecked.

Hi,

Can you share screenshot of UiExplorer which indicates the target element?

Regards,

Hi, this is the screenshot of it. Should I override default value to 11 since I click 11 on the picker date?

image

Hi,

For now, can you modify the selector in SelectorEditor as the following?

Default value of row_index_uad is 5.
Default value of col_index_uad is 5.
tag=‘TD’ (not DIV)

Then press Validate?

Regards,