  We investigate the cosmological test based on the evolution of the gas
fraction in X-ray galaxy clusters and the stability of the cosmological
parameters derived from it. Using a sample of distant clusters observed by
XMM-Newton and Chandra, and comparing their gas fraction at different radii to
the gas fraction observed for nearby clusters, we have determined the
likelihood functions for $\Omega_m$ in a flat universe and the confidence
contours in the $\Omega_m-\Omega_{\Lambda}$ plane. Results obtained at the
virial radius point to a high matter density Universe, while for inner radii
the $\Omega_m$ parameter obtained tends to decrease, reaching values compatible
with the concordance model. The analysis allows us to conclude that this test
provides ambiguous results due to the complex structure of the ICM that induces
a dependence of the gas fraction with temperature, radius, and redshift which
cannot be accounted by a self similar argument expected in pure gravitational
heating of the ICM. The use of gas fraction in X-ray clusters to constrain
cosmological parameters seems therefore to be compromised until a better
understanding of the ICM physics and the ability to obtain observations of
better quality up to the virial radius are achieved.
