The principle behind this test is to release the attached halogen atom as a halide ion. The halide ion can then be identified with a silver nitrate test. The halide ion can be released using a nucleophilic substitution reaction with aqueous sodium hydroxide.
0.5 cm3 of suspected halogenoalkane is added to a test tube, followed by 1 cm3 of ethanol and 1 cm3 of sodium hydroxide solution. The halogenoalkane is immiscible with water, but the added ethanol allows it to dissolve in the aqueous sodium hydroxide. The tube is heated in a boiling water bath for a few minutes. Dilute nitric acid is added until the mixture is acidic (otherwise brown silver oxide is precipitated). A few drops of 0.02 M silver nitrate solution is now added. The production of a precipitate indicates a halogenoalkane:
You can find more details about the silver nitrate test for halides here, and a comparison experiment here.