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:- https://blog.rebrandly.com/the-6-best-url-shorteners-and-how-to-choose-the-right-one-for-you/

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 (https://blog.rebrandly.com/the-6-best-url-shorteners-and-how-to-choose-the-right-one-for-you/)
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