The paper considers tests for the presence of a random walk component in a stationary or trend stationary time series and extends them to series which contain structural breaks. The locally best invariant (LBI) test is derived and the asymptotic distribution obtained. Then a modified test statistic is proposed. The advantage of this statistic is that its asymptotic distribution is not dependent on the location of the breakpoint and its form is that of the generalised Cram?r-von Mises distribution, with degrees of freedom depending on the number of breakpoints. The performance of this modified test is shown, via some simulation experiments, to be comparable to that of the LBI test. An unconditional test, based on the assymption that there is a single break at an unknown point is also examined. The use of the tests is illustrated with data on the flow of the Nile and US Gross National Product.