How widespread were these impotence trials? Was it a localized phenomenon? How long did it last? When did it end? I’ve only found pop culture type articles about this so I’m curious what historians think.
I am not, in any way, qualified to speak for all of Europe but I can give some insight into Ireland specifically.
Our oldest Irish legal records are the Brehon laws which are typically dated to the 7th-8th centuries. In particular, the tract Cáin Lánamna deals with couples: the different forms of sexual relationships, the rights and responsibilities of parents but most importantly for our purposes, the legitimate reasons for divorce and the ways property should be divided in such cases.
There were a variety of reasons that were considered valid grounds for divorce such as mutual unhappiness, adultery, stealing and causing shame. A man could be granted a divorce if his wife had induced an abortion or murdered their child, and women could seek divorce if her husband hit her and caused a blemish, if he was gay, or if he was sterile, if he engaged in 'locker room talk,' or, as you asked, if he was impotent or too fat to be capable of sex.
By the 14th century in Ireland there were two distinct groups: the Gaelic Irish and the Anglo-Irish. The Gaelic Irish were those native to Ireland, while the Anglo-Irish were the descendants of the Anglo-Norman settlers who had arrived during the 12th/13th centuries.
The Gaelic Irish were, from what we can tell, still following the Brehon laws for the most part - especially with regards to marriage. Their customs weren't bound to that of the Church, and practices such as mutual divorce and polygamy were still performed (with the author of Bretha Crólige using Old Testament evidence to justify the polygamy.) Even so, the Gaelic Irish did utilise the Church and Anglo-Irish courts to settle their marital disputes. Based on complaints from Anglo-Irish writers, especially clergymen, there is a fair amount of evidence that the Gaelic Irish were practising their own marital customs (and continued to do so until the 17th century,) which included divorce and therefore likely included divorce on the basis of impotence.
We know that if the husband was found to have gone into the marriage knowingly impotent, and had willfully hidden it from his wife that the compensation he owed her was greater than if he had been ignorant. Equally, if the wife had entered into the marriage without knowing about the husband's impotence, she was understood to not have given informed consent and the marriage (specifically, the contract of marriage) was considered invalid. Though, unfortunately, we don't have any Gaelic Irish legal proceedings or records from this time that would shed light on exactly how these decisions were made, or what sort of procedures or proceedings were followed. The laws are clear, how they were carried out, are not.
The Anglo-Irish, however, were bound by both ecclesiastical laws about marriage, but English laws as well. Because of this, we do have evidence, specifically from religious courts such as the Diocese of Armagh, in which the Church was dealing with legal martial disputes. In these records, there are instances in which women request divorce on account of impotence, generally stressing their desire to be a mother and the failing of their husband to fulfill that desire. But, the Church was not prepared to grant such a request without evidence, and from the twelfth century there is evidence of a jury of women performing a physical inspection on the man.
In one 16th century case, the wife accused her husband of impotence, which he denied. The court ordered that they spend the night together and that nine men inspect the husband to determine whether or not he was capable of fulfilling his marital duties. In this particular case, he was. It does also seem that even if a husband admitted to impotence, seven witnesses were required to determine validity.
So, basically, with regards to Ireland, it would seem that in the 14th century both the Gaelic Irish and the Anglo-Irish were able to seek divorce on the grounds of impotence, although we don't know exactly how that was realised in the Gaelic Irish system. As for how long it lasted, I am already reaching a bit in terms of my area of expertise by discussing 16th century material, so I wouldn't feel confident in placing an end-date on it, or even evaluating later sources. But hopefully this is, at the very least, a good starting point for you!
Sources
D.A. Chart (ed.), The Register of John Swayne, Archbishop of Armagh and Primate of Ireland, 1418–1439 (Belfast,1935)
Art Cosgrove, "Marriage in medieval Ireland," in Marriage in Ireland ed. Art Cosgrove (Dublin 1985).
T. R. Forbes, ‘A Jury of Matrons’, in Medical History 32 (1988), 23-26
Fergus Kelly, A guide to Early Irish Law (Dublin, 1988).
Gillian Kenny, "Anglo-Irish and Gaelic marriage laws and traditions in late medieval Ireland," in Journal of Medieval History, 32:1, 27-42
Neill McLeod Early Irish contract law (Sydney, 1992)
Brónagh Ní Chonaill, "Impotence, disclosure and outcome: Some medieval Irish legal comment" 2007.
Kenneth W. Nicholls, Gaelic and Gaelicised Ireland in the Middle Ages (Dublin, 1972)
Donnchadh Ó Corráin, "Marriage in Early Ireland" in Marriage in Ireland ed. Art Cosgrove (Dublin 1985) 5-24.
W. G. H. Quigley and E. F. D. Roberts (eds.), Registrum Iohannis Mey: The Register of John Mey, Archbishop of Armagh 1443–1456, (Belfast,1972)
Katharine Simms, “The legal position of Irish women in the later middle ages, in Irish Jurist X (1975): 96–111.
Katharine Simms, ‘Women in Norman Ireland’ in Women in Irish Society ed. Margaret MacCurtain et al. (1978), 14-24.
A. Watt, “Negotiations between Edward II and John XXII concerning Ireland,” in Irish Historical Studies 10"(1956–57):1–20.