It's possible to do this before birth. It’s always best to consult with a good family law attorney to discuss the details before you act. See my AVVO Legal Guides on paternity for more information about the legal issues raised by your inquiry. Click on my photo. On my AVVO home page click on "View Contributions" or scroll down further and click on "Legal Guides." Scroll down the list of my 29 Legal Guides and select the topics relevant to your question. If you like my answer and Legal Guides, please make sure you mark them as “helpful.”
This AVVO Answer is provided for general educational purposes only. By using or participating in this site you agree and understand that there is no attorney client relationship between you and the attorney responding, and no attorney-client confidentiality. The law changes frequently, and varies from jurisdiction to jurisdiction. The information provided in this Answer is general in nature and may not apply to the factual circumstances described in your question. The applicable law and the appropriate answer may be different in the State or States where the relevant facts occurred. For a definitive answer you should seek legal advice from an attorney who (1) is licensed to practice in the state which has jurisdiction; (2) has experience in the area of law you are asking about, and (3) has been retained as your attorney for representation or consultation. Your question and the attorney’s answer may be used for promotional or educational purposes
If he agrees the child is his, you can get it done prior to birth, if not, you will have to wait until the chidl is born to do genetic testing.
Please note that THESE COMMENTS ARE NOT INTENDED AS LEGAL ADVICE and are for informational purposes only. This response is not intended to create any attorney-client relationship and is only based on the limited facts given. The response might change should additional facts be learned and should not be relied on as legal advice. It is recommended that you consult with an attorney who can properly assess the situation, as well as all pertinent facts, prior to taking any action based on the foregoing statements