How to test for successful connection depends on whether you are using an Ethernet shield or a WiFi shield.