Praise be to Allah
If a woman needs to do medical tests urgently, then she must break her fast, such as x-rays that require drinking certain fluids beforehand, in cases where delaying the tests may delay recovery or may delay detection of the disease, and so on. In that case she comes under the same rulings as one who is sick, so she may break the fast on that day, but she has to make it up later on.
Shaykh Saalih al-Fawzaan (may Allah preserve him) said:
In the case of a sick person who will face difficulty if he fasts, or it may cause complications in his sickness, or delay recovery, he is granted a concession allowing him not to fast.
End quote from Majmoo‘ Fataawa ash-Shaykh Saalih ibn Fawzaan (2/407)
Please see also the answer to question no. 12488
The questioner did not mention the nature of these medical tests that require her to do ghusl.
If these tests require emission of maniy from the woman:
-If it is emitted with desire, then ghusl is obligatory and it breaks the fast; she has to make up that day only, but she does not have to offer expiation.
-If it is not emitted with desire, then it does not require ghusl and does not break the fast, and her fast is valid.
Ibn Qudaamah (may Allah have mercy on him) said in al-Mughni (3/128):
If he masturbates with his hand, then he has done something that is haraam, but it does not invalidate his fast unless he ejaculates. But if he ejaculates without desire, such as one who emits madhiy and maniy because of sickness, then he does not have to do anything, because he ejaculated without desire, which is more akin to urination. Moreover, he ejaculated involuntarily and did not cause it to happen, so it is more akin to a wet dream. End quote.
But if it is possible to do these tests at night, not in the day, then that must be done and (in that case) it is not permissible to do them during the day in Ramadan.
For more information, please see the answer to question no. 84409
And Allah knows best.