Summary Outlying events or regime changes may mask cointegration relationships, rendering cointegration tests uninformative. To address this issue we propose tests to detect whether a cointegration relationship holds in any one or more parts of the sample. Specifically, we test the null hypothesis of r0, which can be zero, stable cointegrating vectors against the alternative hypothesis of more than r0 cointegrating vectors existing in some subsample. The tests proposed follow Breitung (2002). They are non-parametric in nature and are invariant to linear transformations of the series. A distinctive feature is that they allow us to detect the hidden cointegration when the system is affected by an unknown number of regime changes of unknown timing. We analyse the limiting distributions and provide tables of critical values. Various extensions are then discussed which incorporate a priori information to improve the power. A simple correction is also proposed to yield improved finite sample performance. Finally simulations are conducted to evaluate the size and power in finite samples.