A device for the ultrasonic testing by means of a local immersion technique of a strip-shaped component section, such as a stringer, which protrudes transversely in the Y-direction from a surface lying in a X-Z plane of a flat component and extends in the Z-direction, comprising - a test head assembly having a test head, and - an automatically operated handling device, such as a portal robot, by means of which the test head assembly can be moved along the component section, wherein the test head assembly has a test head holder accommodating the test head and a counter-holder, each of which abut against a side surface of the component section, wherein the test head assembly has a guide rail extending in the X-direction, along which at least the test head holder is displaceably mounted in a longitudinally movable manner transversely to the component section, and wherein the test head holder and the counter-holder are coupled to each other by means of an actuating member and can be driven from a closed first position into an opened second position, and the device has a holding device, which is configured as a gravitation-compensating device and via which the test head assembly is connected to the automatically operated handling device, wherein the holding device has a base plate, which is connected to the automatically operated handling device, with a top side from which guide cylinders (104, 106) extend in which first guide rods (108, 110) are mounted in an axially displaceable manner, wherein first ends of the guide rods (108, 110) extending underneath the base plate are connected to each other via a connecting block having a rotary joint to which the test head assembly is attached and rotatably mounted about an axis extending in the Z-direction, wherein second ends of the guide rods (108, 110) extending above the base plate are connected to each other via a connecting member, which is coupled, via a belt guided over pulleys (126, 128), to a counterweight that is displaceably guided along second guide rods (134, 136) in an opposite direction to the movement of the test head assembly in such a way that the test head assembly is floatingly mounted in a longitudinally movable manner in the Y-direction, and both the test head holder and the counter-holder are floatingly mounted along the guide rail extending in the X-direction and are each spring-biased in the direction of a side surface (34, 36) of the component section. - a test head assembly having a test head, and - an automatically operated handling device, such as a portal robot, by means of which the test head assembly can be moved along the component section, wherein the test head assembly has a test head holder accommodating the test head and a counter-holder, each of which abut against a side surface of the component section, wherein the test head assembly has a guide rail extending in the X-direction, along which at least the test head holder is displaceably mounted in a longitudinally movable manner transversely to the component section, and wherein the test head holder and the counter-holder are coupled to each other by means of an actuating member and can be driven from a closed first position into an opened second position, and the device has a holding device, which is configured as a gravitation-compensating device and via which the test head assembly is connected to the automatically operated handling device,