How to use find text position with ignore case sensitive

Hello everyone,

I m am trying to do a web search, the page is returning more results and i want to click one of them, for example I m searching for john(this is my variable), the page is returning me John or JOHN and right now the activity is crashing because there is no match between the result and my variable only because it is case sensitive. How can I do a simple ignore case sensitive in this activity?

Thank you!

If MyString is the string you’ve pulled containing “John”, “JOHN”, “john”, “JoHn”, etc., your if statement should have the condition MyString.ToLower = "john". This will make the match case insensitive.

I already tried it and it didn`t work with myvariable.ToLower

Then there might be something else in the string other than the word “john”. Try it with MyString.ToLower.Trim = "john".

myvariable.Trim.ToLower is the way I used it. The problem is with what is it comparing, the data returned from the selector.

I would need to know what is being returned to know how to help with this one. The only reason I can think of for this not to match is if the selector is pulling data that doesn’t match “john” in any form. Are you only looking for the string to contain the word “john” rather than match it? If so, you can use MyString.ToLower.Contains("john").

2 Likes

Hey all!

I may be understanding this incorrectly so please correct me where necessary.

If the page is returning John or JOHN, the case of the variable as well as the case of the page need to match. Is there a way that the results may be written to a data table so that manipulation may occur on what is being displayed on the page?

It is easier to force the variable and the result to be lower case than to try match the one to the other (in any form that it may occur).

1 Like

This is the solution I adopted and it is working fine. Thank you!

1 Like

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