A testing device for a packaging machine for packaging products, in particular medical or pharmaceutical products or foodstuffs or dietary supplements, in containers , wherein the testing device comprises: a conveying device , which is configured to convey a plurality of containers in a clocked fashion in a conveying plane in a conveying direction (F) through the testing device ; a plurality of sensors , wherein each sensor of the plurality of sensors is arranged in a testing region of the testing device and is configured to detect foreign bodies, in particular metal foreign bodies, in a container to be tested of the plurality of containers ; and a plurality of carrier elements , wherein in each case a container to be tested of the plurality of containers is received in a testing region by a carrier element of the plurality of carrier elements ; wherein the plurality of sensors and/or the plurality of carrier elements of the testing device , by which the containers to be tested are received in the testing region , are formed movably in such a way that a relative movement between the plurality of sensors and the containers to be tested in a movement direction (B) between a first arrangement and a second arrangement can be generated, wherein the movement direction (B) is oriented perpendicularly to the conveying plane ; wherein the plurality of sensors in the first arrangement is arranged in the movement direction (B) at a distance from the containers to be tested, and wherein the plurality of sensors in the second arrangement at least partially surrounds the containers to be tested; wherein the sensors of the plurality of sensors are arranged one behind the other in the conveying direction (F). a conveying device , which is configured to convey a plurality of containers in a clocked fashion in a conveying plane in a conveying direction (F) through the testing device ; a plurality of sensors , wherein each sensor of the plurality of sensors is arranged in a testing region of the testing device and is configured to detect foreign bodies, in particular metal foreign bodies, in a container to be tested of the plurality of containers ; and a plurality of carrier elements , wherein in each case a container to be tested of the plurality of containers is received in a testing region by a carrier element of the plurality of carrier elements ; wherein the plurality of sensors and/or the plurality of carrier elements of the testing device , by which the containers to be tested are received in the testing region , are formed movably in such a way that a relative movement between the plurality of sensors and the containers to be tested in a movement direction (B) between a first arrangement and a second arrangement can be generated, wherein the movement direction (B) is oriented perpendicularly to the conveying plane ; wherein the plurality of sensors in the first arrangement is arranged in the movement direction (B) at a distance from the containers to be tested, and wherein the plurality of sensors in the second arrangement at least partially surrounds the containers to be tested; wherein the sensors of the plurality of sensors are arranged one behind the other in the conveying direction (F). <EOS>