He attended Bradford Technical College and then the University of Leeds where he qualified Bachelor of Science in 1905. He gained a Doctor of Science degree from the University of London in 1909.
Hartley worked in India for four years then returned to the Lister Institute in 1913 but joined up with the Royal Army Medical Corps (Royal Army Medical Corps) and served as a captain from 1915-1919 during the First World War. Hartley then worked for 3 years at the Wellcome Physiological Research Laboratories and in 1922 joined the National Institute for Medical Research where he became director of biological samples. He stayed till 1946 when he joined the London School of Hygiene & Tropical Medicine.
He worked at the Sir William Dunn School of Pathology from 1949-1953 and at the Lister Institute again from 1949-1953.
In the 1940s he worked with Ralph Kekwick.