Condition in an If statement is not returning the correct output

Hey everyone, I am trying to fetch the value from the website and then trying to perform a dynamic click function.

But in my if function it is always returning false to me even A==A but it still say False.

Attached herewith is the screenshot of my if condition. Your help will highly be appreciated.

Thank you, all!
conditionError

Hi @Muhammad_Anas_Baloch ,

Try including .trim while comparing the values. This will rule out the scenario where extra spaces are there and the Equals functions won’t return true in such cases.

Regards,

1 Like

I already tried it but it wouldn’t worked for me

@Muhammad_Anas_Baloch , before comparing can you display both the values using write line?

Regards,

1 Like

@Muhammad_Anas_Baloch

Try adding .ToLowe.Trim on both the sides…and check also…please print and chekc if there are any differences

Cheers

1 Like

The solution is Series_Label was getting the whole text from the string at once instead of one by one I just changed the For Each Ui Element to extract table and it works for me.

Thank you all for your time.

2 Likes

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