Like any other cycling test, you need to used to the test.
I’ve done the ramp test 3 or 4 times now. My last one felt the most ‘successful’.
I didn’t mess with anything. Didn’t bother with gear changes. I just kept my butt on the seat and kept pedaling until I wasn’t pedaling anymore. My cadence had gone from the 90’s down to maybe the 70s or 60s and then I was just done.
I’d recommend that you do the same. Just pedal until there’s nothing left in your legs. Don’t worry yourself with anything like shifting. I really think that your oxygen demand at the end of this test is so severe that if you waste your energy thinking about shifting gears your going to quit earlier than where you maybe could have.