Digital microfluidic biochips (DMFBs) are widely used in the field of biochemistry. Effective off-line and on-line test for the biochips are required to ensure the system reliability. For direct addressing digital microfluidic biochips (DDMFBs), each control pin corresponds to only one electrode, and that can facilitate the testing of such biochips. However, in pin-constrained digital microfluidic biochips (PDMFBs), multiple electrodes may share one control pin, and thus the testing will be more difficult. In this paper, the pin constraint formula for PDMFBs with connect-5 structure is derived. A novel pin assignment scheme is also proposed, which can conduct on-line test that rarely considered by the previous methods. Furthermore, a hybrid method combining the priority strategy and genetic algorithm is introduced for the on-line test of pin-constrained digital microfluidic biochip with connect-5 structure. The simulation results show that the shortest test path acquired by the proposed method is equal to the optimal value of Euler path, which indicates that the method can effectively implement the on-line test of PDMFBs with connect-5 structure.