[1] He was the son of John Cockburn, a gentleman of some estate in the north of Scotland, who married a sister of Patrick Scougal of Salton, afterwards bishop of Aberdeen.
In 1673 he became tutor to Lord Keith, son of George, Earl Marischal, and remained in this situation till 1675, when he was ordained by his uncle, who presented him on 14 February 1676 to the living of Udny, Aberdeenshire.
On 31 August the Test Act was passed, compelling the holders of all offices, civil and ecclesiastical, to swear adherence to the confession of faith of 1560, and to pledge themselves to support the existing government of church and state.
Cockburn refused the test (of which his uncle the bishop was one of the strongest opponents), but early next year (1682) he complied with the act, being among the last of the clergy of Aberdeen diocese to do so.
Robert Wodrow states that the Scottish bishops issued blank warrants to their clergy for the appointment of elders, leaving them to fill in the names of men who, it was known, would not serve, for the purpose of mulcting them in the courts.
Cockburn's first literary enterprise was a spirited project of a monthly magazine of literature; but the first number (for January 1688) contained passages unpalatable to members of the Catholic Church, which was now tolerated by the king's proclamation, and the publication was stopped.
He crossed to France and attended the court of King James at St. Germain; but here he was importuned to change his religion, and declining to do so was sent off as a dangerous man.
As he was "preparing to take up his residence at one of them", the vicarage of Northolt, Middlesex (then called Northall), fell vacant, and at the instance of Queen Anne, John Robinson, bishop of London, the patron, presented Cockburn, somewhat unwillingly, on 8 June 1714.