How to find URL is valid or not

Hi All,

I need to check whether given URL is valid or invalid and session time out.
URL is the input file which is not constant…
We will get different URL…
Any plz suggest how to do…

Thanks

Could you please narrate steps how you test them manually.
Example:

  1. open excel spreadsheet.
  2. Open Browser
  3. Copy URL
  4. Paste URL in the Browser.
  5. Wait until URL get time out.
  6. If Broken write into the excel comments … “URL broken”
    Repeat abive steps for all URL until End of the File… etc…

If you already narrate… please share… anyone from forum can help you to convert them into Robot Process… else… adopt what i have narrated above steps and convert them.

Hope my inputs are useful.

You could try this inside Invoke Code activity.

If this code below does not return error then you can use the Open Browser window and use your URL because you know It’s good.

@vaishali… can you please show us few sample URL which you are referring to?

I am thinking of Regex…let me first see your URLs

Agreed. Regex is great if people can understand the expression after revisiting the code 6 months later. Funny thing about Regex is that " they are easier to write than to read" :slightly_smiling_face:

@AndyMenon - Regex is not hard…If yourself want to learn Regex please go through the below video…I watched this video and practiced for one whole day, now i am able to solve 70-80% of the Regex even though i am not expert…

I have used Regex to extract information extensively. My latest automation contains at least a dozen Regex expressions for this purpose.

But in the interest of better supporting our applications in the future, and that includes handing it off to someone, I use a measured approach in using Regex.

I had to document each of the Regex I used so that it is easier for someone to take it & support it in the near future.

Especially a Production support engineer who won’t be able to fix any Regex related issue in a matter of minutes. :slightly_frowning_face:

@AndyMenon - I have been in both coding and Prod support for so many years. Developers can’t do everything easily just because prod support won’t understand.

Developers job is to build robust code so that it won’t break often giving big headache to prod support.

Agreed. But we can’t control factors outside our control.

If that weren’t true we wouldn’t need things like logging and exception handling :slightly_smiling_face:

@AndyMenon - Always something will break…I know we can’t control it…

Even software upgrade also causes problems to the robust code, that doesn’t mean that you can’t upgrade your software…right? …

Absolutely.