To set up integration with a PayPal sandbox account, you must alter your Gateway settings. To find these, navigate to Global Settings > Payment Methods/Gateways > Payment Gateways. Locate the PayPal gateway associated with your store. You must be using either PayPal Express Checkout, PayPal Payments Standard or PayPal Payments Pro. PayPal PayFlow Pro does not support a sandbox environment.
PayPal Express Checkout
Change the Config String setting to Enable Sandbox Mode by going to Tools > Apps & Addons > PayPal Express Checkout
PayPal Payment Standard or Pro
You will need to navigate to Settings > Payments & Taxes and change the Alternate Url in your PayPal Payment Gateway Settings to https://api-3t.sandbox.paypal.com/nvp.
Save the changes to the gateway and transactions will go through the sandbox mode.
Note: This is not recommended for production use or if your store is live.