The deflection in the needle shows that there is current in the wounded wire of tester.
Solution has ions present in it causing electric current. Electric current produces magnetic effect causing deflection of the magnetic needle of a compass. Therefore, when a tester is dipped in the solution, the needle shows deflection, being a good conductor of electricity.