Specifically, how could they determine whether the female or male in the couple is infertile? I tried to find answers online but I guess I didn't use the right search query. I am wondering that technology they had available.
Probably the most widely disseminated and dispersed manuals on "generation" or sexuality were Physiological Mysteries in Love, Courtship, and Marriage by Eugene Becklard M.D. (translated by Phillip M. Howard M.D.), which went through at least three Parisian editions (I couldn't find any discussion of its circulation elsewhere), and the book Aristotle's Masterpiece, which had 27 printings in the United States (according to the National Medical Library's collections). The latter, published originally in England in 1684 and printed in the United States throughout the late 18th and early 19th centuries, is the most likely candidate for giving an insightful picture of the diagnosis of infertility. A secondary source, D'Emilio and Freedman's Intimate Matters, gives little information on diagnosis during this period aside from the inability of the man to maintain an erection or perform the "act of generation."
The pseudo-Aristotle that wrote Aristotle's Masterpiece argued that it was the depletion of "vital heat" and "vital moisture" that caused barrenness among men and women. It reinforced a popular opinion that sexual energy was limited, that women had a lesser amount of this "vital heat" and that their "vital moisture" dissipated sooner due to menstruation. According to Pseudo-Aristotle, barrenness "is caused by overmuch cold or heat, driving up the seed and corrupting it, which extinguishes the life of the seed, making it waterish, and unfit for generation." It does not discuss the signs of infertility among men. Because sex was an act of complementarity (i.e. requiring two complementing dispositions), the improper matching of a male and female genitalia is a primary cause of infertility (the book says when both are the same moistness or temperature e.g. both dry or both cold). The manual subsequently describes the following as a diagnostic: "if any woman be suspected to be unfruitful, cast a natural brimstone, such as are digged out of the mine, in her urine, and if worms breed therein, of herself she is not barren." The vital fluid was semen, or the seed, of which all other fluids were a form.
Pseudo-Aristotle didn't give any diagnostic tools for men. It seems the main cause of barrenness was considered to be the fault of the woman. Aristotle, upon whose work De Generatione Animalium or On the Generation of Animals the pseudo-Aristotle is based, argued that semen comes from all parts of the body. The only difficulty for infertility in men would be the temperature of their semen, which is a tool by which to diagnose the general health of the male. Other health problems might cause the decline in temperature of male semen or the organs that stored it, which would mean that the male is less capable of producing offspring. Aristotle's Masterpiece is not explicit on what these conditions might be. He differs from the original Aristotle, who argued that the semen must be kept warm perpetually in both male and female for reproduction.
The book by Becklard argued that the causes of unfruitful marriages were "the mutual coldness of the parties [to marriage]; another the mutual intensity of desires; a third their unfitness, in consequence of the difference of their physical construction, for sexual intercourse." The irregularity of female menstruation as well as "self-abuse" (masturbation) were causes of this "unfitness" for intercourse. In the author's opinion, "unfitness for intercourse is one cause of unfruitfulness. It is, however, a rare one." He argued that only one in five-hundred married couples had that particular deficiency. This text does not appear to define any tools of determining impotence except for the absence of children in marriage. The chief cause of this is "weakness or debilitation" caused chiefly "by severe labor, libertinism, long residence in an unhealthy climate, secret habits [probably masturbation], mostly acquired at school and other causes." At the time, because reproductive sex was considered normal, the concept of impotence was limited to situational problems, and Becklard concludes that the "weakness or debilitation [that causes sterility] may be in some instances natural, but it is generally an artificial result."