While loop not working in orchestrator

Recently while loop is not working in local so i downgraded packages and it is working, so when in orchestrator same is not working for this condition optext<>“January 2021”

@Sathish_Kumar5,

As you are comparing the string datatype, try putting condition like this:

String.Equals(optext, "January 2021")

Why to use String.Equals?
The string.equals() method compares two strings and returns true if all characters match in both strings, else returns false** . The =,<,>,<> operators compares the reference or memory location of objects in a heap, whether they point to the same location or not.

Thanks,
Ashok :slight_smile:

Actually thanks for trying to help so what i want is i want to choose january 2021 in calender so i used while condition optext<>“January 2021” and this worked fine in my local laptop but it is not working in server orchestrator. so i used while loop to click till it reaches january 2021

image

@Sathish_Kumar5

Got it! Still I would suggest to give it a try to String.Equals to compare strings. I think this will solve your issue.

By the way, what’s error or behavior you are observing when you say it’s not working?

Thanks,
Ashok :slight_smile:

Like loop doesn’t seem to end it keeps on clicking the highlighted part

@Sathish_Kumar5,

It may be due to get text is not returning matching string which is equals to “January 2021”.
Log the value of optext to see if it’s holding the correct value to compare.

Thanks,
Ashok :slight_smile: