Even with a new battery, if it isn't charging then that won't work. And, if it is an aftermarket battery it may not work either.
Try turning off the laptop and see if it will charge then. If it charges when off, but not when turned off, then the charger is the problem. It isn't putting out enough power to do both and would need replacing.
However, if it won't charge no matter if off or on, but the laptop runs when plugged in, that battery (new or not) is the problem.