Materials tests are inevitable to investigate how materials behave under load. This also holds for materials that are not manufactured from bulk material but exhibit an interesting microstructure. Unfortunately, in this case classical stress-strain investigations are no longer sufficient to deduce a proper description of failure mechanisms. To overcome this problem, materials testing is usually combined with an imaging modality to gain information on local material behavior. The combination with classical digital cameras is quite common, but only yields surface information. Here, we present a framework to combine mechanical tests with computed tomography. Such in situ tests are not new, however, we also give information on how to perform tests ex situ. Our special focus is on motion estimation. We use an algorithm that is particularly suitable for delicate behavior of materials with interesting microstructures such as foams. The whole pipeline for materials tests, either in situ or ex situ, is outlined using two foam examples.