Rough Idle and hesitation

I have a 2001 Subaru outback with 167,000 miles. Recently it has been running rough. I changed the fuel filter, changed the spark plugs and wires, changed the air filter, checked the vacuum which was normal and just changed the ignition coils. I can’t figure out why the car still idles rough at a light (usually)and most take offs have a hesitation. The car seems to run fine while traveling local roads and on the highway. The situation has been going on for a while. Gas milage through this has not suffered. What gives with the family chariot?

NEW INFO. The problem gets worse in humid/rainy weather and more so when the window defogger is activated. The check engine light came on throwing code P0302. What could be the solution to this conundrum?

Why didn’t you just add your “NEW INFO” to your old post?

Another very possible cause is a problem with your cam position sensor. Also you should determine which cylinder is misfiring and check that injector for firing and leaking.

I have been having problems with microsoft script errors getting to the reply screen.
Anyway. The misfiring cylinder is #2. Finding and checking sensors is not a problem. How do I test an injector for firing and leaking?