if the iPad can't connect to the internet because of a defect, which would be the worst thing that could happen, it is nothing to worry about, all you have to do is go to iCloud.com (
https://www.icloud.com/#find ) and click on all devices, click on the iPad. and tell it to erase , and then click on remove from account
when you use iCloud.com from another computer to erase the iPad you have to remove it also
if you erase the iPad and do not remove it, it will be locked to your iCloud account and will require your password to activate
if you erase your iPad and remove it, it might show on its lock screen that it still belongs to you, but as soon as you click on the set up process and it connects to apple.com , all the iCloud activation locks are disabled
whenever the iPad is repaired or comes back , it will self destruct if it should ever connect to the internet again
tell the store when you return it that the iPad is defective and you erased and removed it from iCloud.com
if that won't work, then have the apple store replace it, it sounds like from your post that it is still under warranty, ask them for help
double check the iPad and try to connect to other wifi networks to rule out your wifi network
if you have a bunch of iPads and you don't know which is which, you can make them ring to make sure you erase the right one
make sure you back up your ipad to itunes before you replace it
also click on the file, device menu to transfer purchases, that way anything you bought and any software updates are backed up to itunes as well
tell the store they can go to
https://www.icloud.com/activationlock/ and enter the serial number to check to make sure you turned off find my iPhone using iCloud.com