You might be able to do it in a slope/resistance mode without shifting but that would also require a bit of manually adjusting resistance or cadence. Probably not too bad as it’s mostly steady state.
There are a few other threads on this forum regarding the ramp test and testing in general but this is a good article to give a read.