I avoided because the question was specific on testing door switch.
But if you open to other ideas here is what I thought when I 1st read the post.
I recall one time I had the similar if not exact same scenario basically where door was shut and steps were extended and the should have been in (based on switch). Even when engine was running they should have been in. It was under warranty and Kwikee Step diagnosed as a bad controller. But I didn't think it was really a controller just a quirk with the testing of the real problem I had that was chronic and persisted for almost 2 years that dealer could not resolve.
That issue was my steps would randomly retract on it's own. That was when switch was set for steps to stay extended when door was closed. I never put the new replacement motor on, because I was able to prove to myself the issue was NOT the controller. The controller requires a 12vdc as input from the switch to know to NOT retract the steps if door is closed.
One day while on opposite of coach, I shut a compartment door, and then I heard the steps retract
For some reason I lost voltage even though the switch was closed and working. So I traced back all the way to the breaker and found no issue
I then pulled the wires behind panel that go from 12vdc buss to breaker. I learned that while I had solid power from 12vdc buss to a 9 pin connector, I was not getting 12vdc out the pin from connector that fed the switch. I took the connector apart and found the male pin that fed the switch was not inserted into the female in to get a consistent solid connection, thus the randomness. I reseeded and have not had a problem with the steps since. I have also not been back to the Dealer since as they had charged me a checkout fee because they could not replicate the problem. They said I had no problem, but when it happened again, they were going to charge another checkout fee