Aims. Power-law cosmologies, in which the cosmological scale factor evolves as a power law in time, a ∝ t α with α > ∼ 1, regardless of the matter content or cosmological epoch, is comfortably concordant with a host of cosmological observations. Methods. In this article, we use recent measurements of the X-ray gas mass fractions in clusters of galaxies to constrain the α parameter with curvature k = ±1, 0. Results. We find that the best fit happens for an open scenario with the power index α = 1.14 ± 0.05, though the flat and closed model cannot be ruled out with high confidence. Conclusions. Our results are in agreement with other recent analyses and show that the X-ray gas mass fraction measurements in clusters of galaxies provide a complementary test of the power-law cosmology.