How to compare two URL's which is stored in two different variables

Hello guys, here is my topic.

I want to compare two URl’s with large length for ex:- The 6 Best URL Shorteners and How to Choose The Right One

i explain what i done
First i get the URL by using Get Attribute and store it in a variable called GetUrl,
then,
i compare it in if condition
if GetUrl=BaseUrl (The 6 Best URL Shorteners and How to Choose The Right One)
then
Show Message box(in if)
Else
Show Message (in else)

but it fail to compare url’s and execute Else block…!!

Hello,

This is what I do and it works for me.

@swanand_deshmukh

Check it properly once. If one character is missing then it will go to else part only.

Show me screenshot of both variables once.

@swanand_deshmukh,

We have URI as a .net class with System.Uri.

– Create two variables with System.Uri datatype
– Then check this condition in a IF activity

Uri.Compare(UriBase, UriNew, UriComponents.Host Or UriComponents.PathAndQuery, UriFormat.SafeUnescaped, StringComparison.OrdinalIgnoreCase).ToString

ok!!

1 Like