While loop keep running even the conditions are met (datepicker)

Hi,

Currently, I have a while loop that will click the previous page if the condition ‘not(Year_DateFrom=year_date_from) or not(Month_DateFrom=month_date_from)’ met. But now the while loop not breaking even the condition met and keep clicking the previous page…

For your reference:
Year_DateFrom is the expected year
year_date_from is the current year in the datepicker
Month_DateFrom is the expected month
month_date_from is the current month in the datepicker

Let me know if you need more information. Thank you very much!

Hi @Low_Hua_Kuan,

It may be worth logging what the variables are, and looking for differences.

The text could have a space before or after the desired text, you could try .Trim after each of your variables?

1 Like

Better you can print those values which you provided in the IF condition to a message box. I think the condition is not working as expected and thats why it keeps on looping.

Also you need to verify the format of the variables which you created for the comparison.

1 Like

Hi,

Problem solved by replacing the activities to Get Text “May 2022” and then Assign for “month” and “year” instead of using Get Text for “May” and “2022” respectively.

Thanks!!

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