The woman told jurors she eventually got away from the attacker, ran down the road and called for a taxi that arrived quickly.

She went on to text a friend and her sister what had happened.

Patran – who had no permanent address – was arrested following a probe into the attack.

He lodged a special defence during the trial that the doctor had consented to sex.

Days after the attack he appeared in the dock at Glasgow Sheriff Court handcuffed to a female custody officer.

But the court was told that during the hearing she spotted Patran groping himself.

The officer said she was shocked by his actions and the presiding sheriff was alerted.

It also emerged Patran had flashed himself to a woman on a train between Perth and Stirling on 22 October 2023.

Patran was found guilty of all three charges.

He remains in custody and was put on the sex offenders register, pending sentencing next month.