Hello and welcome to JustAnswer!
It would be possible for it to set an evap leak code if you fuel the car with it running. It should always be shut off.
Replacing the gas cap was a good first step. If you just replaced it, it may have fixed it but the light hasn't gone back off yet. It would take a few days of regular driving for it to retest itself three times, and then turn the light off. You could disconnect the battery, and that will clear the codes right away. If the light comes back, you know you still have problems.
If the cap doesn't do it, you've got a leak somewhere else in the system. It could be the filler neck, the lines from the fuel tank to the vapor canister, the lines from the canister up to the engine compartment, and the purge solenoid could also be leaking the vapor right into the intake manifold. check over all of the lines from the filler neck to the tank, the tank to the canister, and up to the engine compartment. You're looking for any holes or cracks in the hoses. This can be as small as .010", so don't be too discouraged if you can't find it. If you can't, a shop will have a special machine for finding these leaks. It hooks into the system and pressurizes it with smoke, the smoke will leak out where ever the cracked hose is, making it much easier than trying to find the leak by eye.
It would be better if you didn't fill it all the way. When the fuel level in the tank is below 15% or above 85% the car won't test itself for leaks, so you wouldn't know for sure if you fixed it or not for a while. Keep it between about 1/4 and 3/4 for a few days after you disconnect the battery, and if you don't see the light again call it fixed!
You're welcome, and good luck. Let me know if you need anything else!