The evolution of software testing technologies has significantly reduced software testing execution times, but the test design and generation are still often implemented with slow manual-oriented methods. Model-based testing (MBT) offers automation to test design and generation, and different MBT solutions are familiar from research, but more effort needs to be done to adopt MBT for industrial use. Hardware in the loop (HIL) is a simulation and testing technique used in the development and testing of embedded systems. HIL is a challenging application field for MBT due to complex and non-deterministic nature of some embedded systems. To tackle this problem, the authors present a novel prototype platform in which online and offline MBT is applied to HIL environment. MBT in general has been introduced for HIL in scientific literature before, but the application of online MBT in HIL is a novel approach. The whole novel MBT in HIL prototype platform along with the used MBT tool, platform architecture and MBT process are presented accompanied by experimental results and analysis of two case studies with an example embedded system under test.