Based on my research through the APA Gender is a subjective term, so the 'Dysphoria' of how a persons feels about being one biological sex and how the current society feels that biological sex should be are both changing standards which are unique based on experience, place, and time.
This is a factual representation of the APA (who supports Gender Dysphoria), yet classifies gender as a social construct. At the very least we should try to understand that technical assessments of the difference between two changing and subjective points are not easily done.
So, my answer is, that while there are tests that are used for this topic as the first answer states, that these are highly subjective and to date there are no scientific factors and assessments to measure this classification.
Scientific tests in my mind would include technical baselines for brain or other biological markers which become standardized over time. Brainwave activity, identified genes are two such options, which currently do not exist.