The gas detectors, operated under harsh radiation conditions like the one foreseen at the High Luminosity LHC (HL-LHC), must fulfill a number of stringent quality control criteria. Based on high-voltage current measurements, the X-ray scanning technique has been developed for discovery of various production defects prior to the readout electronics installation. The later usually happens at the last stage of detector assembly. Thus, it allows testing the quality of the chambers, identifying defects and when possible fixing them already at early stage.