Dilute sodium hydroxide solution is used in tests for some cations, which form insoluble metal hydroxides. The metal hydroxides appear as precipitates.
Aluminium,calcium and magnesium all produce white precipitates
However if excess sodium hydroxide is added the aluminium hydroxide will dissolve and turn colourless whereas the calcium and magnesium hydroxides would remain unchanged