The Unionist Association of South Edinburgh held an executive meeting on 7 June to consider their choice of candidate. They provisionally decided to recommend the adoption of Major General Andrew Wauchope but they agreed not to take any formal steps in the selection until after the funeral of Mr Cox. At the time of the by-election Wauchope was aged 52 and had been an officer in the Black Watch since 1865, having been promoted to major general in November 1898. Politically a staunch Tory, he had previously contested the Midlothian or Edinburghshire constituency at the 1892 general election coming within 690 votes of unseating Mr Gladstone.
It was clearly the intention of the government to get this by-election over and done with quickly as the writ for the election was issued in Parliament on 9 June, just one week after Cox's death and election day was set for 19 June, giving the candidates less than two weeks campaigning time. Dewar had opened the new premises of the SouthMorningside Liberal Club on 10 June and had taken the opportunity to make a short address. He appears to have accused Wauchope of being a Tory, presumably a reference to the fact that the Unionist mantle had passed from the Liberal Unionists to the Conservatives in Edinburgh South, perhaps judging that this would drive some former Liberal Unionist voters back to the Liberal fold, perhaps also appealing for working-class votes in recalling Wauchope's stance in 1892 when he refused to support the Eight Hours Bill proposing the restriction of the working day for miners. Wauchope spoke on the same day, in the evening, at the Edinburgh Literary Institute. He responded by saying there was no disgrace in being a Tory. On social issues, he added that much had been done for the working man by the Tories and if returned as MP he would work as hard for the working man as anyone calling himself a Liberal. Dewar renewed this attack on the state of the Unionist coalition later in the campaign, again alluding publicly to Wauchope's devout Toryism, and arguing that Liberal Unionism was now dead in the constituency. Nonetheless, Wauchope did receive a letter of recommendation from Joseph Chamberlain, the leading Liberal Unionist and at that time Colonial Secretary urging all Liberal Unionists in the constituency to vote for him. Dewar, it was reported, devoted most of his limited campaigning time to meeting workmen. Apart from social questions he also spoke in favour of the taxation of ground values and for the idea of Home Rule All Round, moves towards devolution or elements of self-governance to all parts of the United Kingdom, although he was known to support Gladstone on his policy on all out Irish Home Rule. Dewar also spoke in favour of the disestablishment of the Anglican Church. Wauchope was now focusing on foreign policy and the efforts of the government to promote peace. He also received the support of various Protestant church groups who were concerned about the religious implications of Home Rule in Ireland and aspects of Britain's relationship with the Vatican.
The result
Dewar gained the seat for the Liberals with a majority of 831 votes. A separate by-election in the neighbouring seat of Edinburgh East which took place a few days later also resulted in a lower share of the vote for the Liberal Unionists. Despite this apparent trend however Dewar lost the seat to a Liberal Unionist rival, albeit narrowly, at the general election of 1900 when there was also a modest revival in the Liberal Unionist vote in Edinburgh East. He then won it back in 1906, holding it in January 1910 before resigning from Parliament latre that year upon appointment as a judge. The result of the by-election was not therefore a reliable pointer to the outcome of the next general election, as no doubt Edinburgh Liberals hoped – although the political situation would be transformed by the time of the 1900 Khaki election as a result of the country's involvement in the Boer War and the depiction of many Liberal candidates as pro-Boer and unpatriotic. As to Major-general Wauchope, he did not get the chance to stand for Parliament again as he was killed in action on 11 December 1899 during an engagement at Magersfontein in the Boer War and was buried at Modder River in South Africa.