Several different problems could prevent a dehumidifier from collecting water even though it runs. If the unit is running but the evaporator is no showing any signs of frost or cooling, then you could have a sealed system failure or a lack of Freon. A failed compressor would also prevent the unit from cooling in order to collect moisture. Check to see if just the fan is running or both the fan and compressor are running.
Check the settings and the relative humidity in the area where you are using the dehumidifier. If you have the unit set to dehumidify to 70% and the relative humidity in your local area or the space where you are using the unit is less than that, then the unit will not likely collect any moisture even though the fan is running. The maximum setting is normally about 35% for most models of dehumidifiers. See if the unit will collect moisture at that setting. If you are using an air conditioner in the same space as the dehumidifier, then the air conditioner is likely already dehumidifying the air and the dehumidifier will not remove additional moisture.
Check the temperature of the space where the dehumidifier is operating. If it is less than 65 degrees, many models of dehumidifiers will not work at this temperature.
A failed electronic control board or humidity sensor could prevent a dehumidifier from collecting moisture.
These general tips may help you determine why your unit is not collecting moisture. For more specific help with your exact model, resubmit your question with additional details and the full model number of your dehumidifier.