Infertility

How is infertility detected ? Is it by lab work? If so, what labs? Or is it through imaging?