This test takes a sample of the fluid that surrounds the baby. It is used to look for genetic disorders. It may also be used to check how well the baby's lungs are developing. In most cases, the test is performed between the 15th and 20th weeks of pregnancy.