William Robertson qualified (MRCVS, London) in 1893 and received further training at the Pasteur Institute in Paris. After working for some time as assistant bacteriologist at the British Institute of Preventive Medicine in London he came to the Cape Colony durig the latter half of 1896 to take up the post of veterinary assistant at the Colonial Bacteriological Institute, Grahamstown, under Dr A. Edington*, colonial bacteriologist for the Cape Colony. For the first few months he assisted Dr Robert Koch* in combatting rinderpest at Kimberley, but joined Edington in May 1897. Late in 1899, having returned to Britain, he was appointed veterinary surgeon in the department of the colonial veterinary surgeon of the Cape Colony, D. Hutcheon*, filling a post left vacant by J.F. Soga*. He arrived back in February 1900 to take up his duties. Two years later he became bacteriologist to the Department of Agriculture, stationed in Cape Town. During these years he was involved in research on, among others, rinderpest (1896-1897), African horsesickness (at Grahamstown), heartwater (with government entomologist C.P. Lounsbury* in 1899), malignant jaundice of the dog (published in the Journal of Comparative Pathology and Therapy in 1901), east coast fever (with C.E. Gray* in Zimbabwe, 1902), and osteoporosis in horses (on which he read a paper at the join meetings of the British and South African Associations for the Advancement of Science in 1905). He also contributed articles on a range of veterinary topics to the Agricultural Journal of the Cape of Good Hope during 1902-1910, and to the Agricultural Journal of the Union of South Africa during 1911-1913.
In August 1906 Robertson was transferred to Grahamstown as director of the Veterinary Laboratory of the Department of Agriculture, formerly the Colonial Bacteriological Institute. The laboratory had become mainly a facility for producing vaccines. As a result of poor economic conditions there was little or no money for research, though he managed to carry out some feeding experiments in connection with lamsiekte (botulism). After the formation of the Union of South Africa in 1910 Robertson was appointed in April 1912 as assistant director of veterinary research of the Union, based in Grahamstown. Later that year he was transferred to the Veterinary Research Institute at Onderstepoort, but owing to ill health was allowed to return to Grahamstown in 1914, where he served the last four years of his life. The farmers of the Albany district presented him with a silver plaque in gratitude for the services rendered to them.
Robertson was a Fellow of the Royal Society of Edinburgh. In 1905 he became a foundation member of the Cape of Good Hope Veterinary Medical Association, served as its first honorary secretary for a year, as a member of council from 1907 to 1912, and as vice-president in 1908. He was an early member of the South African Association for the Advancement of Science, and a member of its council in 1907/8. In 1908 he also joined the South African Ornithologists' Union.