We introduce a technique, traction rheoscopy, to carry out mechanical testing of colloidal solids. A confocal microscope is used to directly measure stress and strain during externally applied deformation. The stress is measured, with single-mPa resolution, by determining the strain in a compliant polymer gel in mechanical contact with the colloidal solid. Simultaneously, the confocal microscope is used to measure structural change in the colloidal solid with single particle resolution during the deformation. To demonstrate the utility and sensitivity of this technique, we deform a hard-sphere colloidal glass in simple shear, and from the macroscopic shear strain and measured stress determine the stress-strain curve. Using the stress-strain curve and measured shear modulus, we decompose the macroscopic shear strain into an elastic and a plastic component. We also determine a local strain tensor for each particle using the changes in its nearest-neighbor distances. These local strains are spatially heterogeneous throughout the sample, but, when averaged, match the macroscopic strain. A microscopic yield criterion is used to split the local strains into subyield and yielded partitions; averages over these partitions complement the macroscopic elastic-plastic decomposition obtained from the stress-strain curve. By combining mechanical testing with single-particle structural measurements, traction rheoscopy is a unique tool for the study of deformation mechanisms in a diverse range of soft materials.