Computer "not ready" to test emissions

I’ve had my used '05 ScionxB for 5 or 6 yrs. This year, for the first time, it couldn’t get an inspection sticker because the DMV machine said ‘your car’s computer is not ready to test emissions’. The mechanic suggested I put 50 or so miles on the car and come back. I did. No luck.
Kept driving and re-testing with no luck. Took it to a local Toyota dealer and they said the same thing. Put about 3,000 miles on it and went back to dealer demanding a solution. They kept it for 4 business days and returned it to me in the same condition with another 50 miles on it and a print out saying it wasn’t ‘ready’.
I’m up to $325 in tickets and ready to scream.
A few people said they’d heard of this sort of thing but what most people say, including me, is this is Bleeping crazy.
I asked the dealer - ‘why not just replace the computer’ and they answer with some convoluted gobble-de-gook that boils down to - that won’t fix it or something.
Please, somebody, tell me - what am i to do?

@AdrienneWoodduck

Respectfully, you’re probably not driving the car under the right conditions for the requisite number of monitors to run to completion

Put another way, your driving style hasn’t allowed the computer to be ready

I meant no offense

Did you recently replace the battery?

Did you recently repair some problem and clear fault codes?

Is the engine coolant temperature getting up to proper temperature within a reasonable time frame?

If it was my car, the first thing I would do is make sure all of the maintenance was up to date, and I’d also replace the coolant and the thermostat.

Sorry you are having this frustrating experience.

It seems like 3,000 miles of driving should do he trick. hmmm … well, if it were my car I’d have the battery load tested, then check to make sure the battery connectors are clean and tight, then I’d take a trip involving freeway, stop and go city, and some rural driving. And some stops for burgers & fries, etc. Will make for a fun Sunday afternoon even if it doesn’t work.

Still a no-go? Then I’d suspect some kind of intermittent problem with power to the ECM. Fuse on the fritz, connector corroded, etc. Something must be intermittently resetting the ECM, putting it back in its initialization mode. (BTW, if you are disconnecting the battery to turn off the CEL in order to pass the test, this won’t work. Your car’s computer knows the battery was disconnected and tattles on you to the inspection station.)

Since this is related to emissions testing, also be sure to phone up the department in charge of emissions testing in your state. You may be able to get a waiver and won’t have to pay for the tickets either. Worth a shot anyway.

Drive it for at least a half hour on the highway at highway speeds (avoid rush hour), then take it back for the test. That’s what Maryland recommends, and standards are about as tough here as anywhere.