Check Internet Is working or not

I want to apply a condition according to internet connection is working or not but here is problem with me every time it shows true in dialog box with internet connection or without internet connection.Help me

1 Like

@Sandeep_Kumar2

you can check internet connection using Http Request activity. Provide any valid http URL in “End point” parameter and get the http response code as output from “Status code” parameter. If status code is 200 then your internet connection is active.

did not get your point bro

Hi Sandeep,

Can you advise which part of @ranjith’s answer you did not understand?

Cheers,
Josh

@Sandeep_Kumar2 what @ranjith is trying to say is

Use HTTP Request Activity

image

If you do not see that in you activity pane, install package UiPath.Web.Activities

After this in HTTP Request activity properties “EndPoint” give a valid URL like Google.com

And the check the Property StatusCode after running this if its value is 200 then internet is working. It is quite a good option but i am not sure if it is the best one

1 Like

Hi @Sandeep_Kumar2,

Kindly check the example attached:
Main.xaml (5.4 KB)

1 Like

Error regrading the code to check internet connection here what i m gonna do to solve this

here is the error

Error Compiling code
error BC30002 : type ping is not defined a line 2
error BC30002 : type ‘pingOption’ is not defined a line 6
error BC30002 : type ‘pingReply’ is not defined a line 7

help