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 through the testing device; a first and a second sensor (26, 30), which are each arranged in a testing region (28, 32) of the testing device and which are each configured to detect foreign bodies, in particular metal foreign bodies, in a first or second container (4a, 4b) to be tested of the plurality of containers; and wherein the first and the second sensor (26, 30) and/or a first and a second carrier element (46, 48) of the testing device, by which the first or second containers (4a, 4b) to be tested are received in the testing region (28, 32), are formed movably in such a way that a relative movement between the first and the second sensor (26, 30) and the first or second containers (4a, 4b) to be tested in a movement direction between a first arrangement and a second arrangement can be generated, wherein the movement direction is oriented perpendicularly to the conveying plane; wherein the first and the second sensor (26, 30) in the first arrangement are arranged in the movement direction at a distance from the first and second containers (4a, 4b) to be tested, and wherein the first and the second sensor (26, 30) in the second arrangement at least partially surround the first and second containers (4a, 4b) to be tested; wherein the first and the second carrier element (46, 48) are formed in such a way that they support the first and second containers (4a, 4b) to be tested from below in the first and in the second test region (28, 32), and in such a way that they are movable in the movement direction; characterised in that the first and the second sensor (26, 30) are arranged below the conveying plane and the first and the second carrier element (46, 48) are lowerable relative to the conveying plane; and the first and the second sensor (26, 30) are arranged one behind the other in the conveying direction. a conveying device, which is configured to convey a plurality of containers in a clocked fashion in a conveying plane in a conveying direction through the testing device; a first and a second sensor (26, 30), which are each arranged in a testing region (28, 32) of the testing device and which are each configured to detect foreign bodies, in particular metal foreign bodies, in a first or second container (4a, 4b) to be tested of the plurality of containers; and wherein the first and the second sensor (26, 30) and/or a first and a second carrier element (46, 48) of the testing device, by which the first or second containers (4a, 4b) to be tested are received in the testing region (28, 32), are formed movably in such a way that a relative movement between the first and the second sensor (26, 30) and the first or second containers (4a, 4b) to be tested in a movement direction between a first arrangement and a second arrangement can be generated, wherein the movement direction is oriented perpendicularly to the conveying plane; wherein the first and the second sensor (26, 30) in the first arrangement are arranged in the movement direction at a distance from the first and second containers (4a, 4b) to be tested, and wherein the first and the second sensor (26, 30) in the second arrangement at least partially surround the first and second containers (4a, 4b) to be tested; wherein the first and the second carrier element (46, 48) are formed in such a way that they support the first and second containers (4a, 4b) to be tested from below in the first and in the second test region (28, 32), and in such a way that they are movable in the movement direction; characterised in that the first and the second sensor (26, 30) are arranged below the conveying plane and the first and the second carrier element (46, 48) are lowerable relative to the conveying plane; and the first and the second sensor (26, 30) are arranged one behind the other in the conveying direction.