See Our New JEE Book on Amazon
A magnetic dipole does not experience any force in a uniform magnetic field.
A magnet is made of collection of small magnetic dipoles. Each dipole can be treated as a combination of north and south pole of equal strength. For the same magnetic field B and same strength of the two poles, the forces by the field on the two poles will have the same magnitudes. As the directions are opposite, the net external force will be zero on each dipole and hence on the magnet. Is this experiment you see it in real time.
This demonstration needs a solenoid, DC source, a small cylindrical magnet, a sensitive spring balance, arrangements for hanging the magnet and keeping the solenoid vertically.
The magnetic field in an infinite solenoid is $\mu_0 n I$, independent of the distance. For a finite solenoid with length several times the diameter, of the reading, the field will be nearly uniform in the central region but non uniform near the ends. The non uniform field exerts net force on the magnet which is shown on the spring balance.