igniter lights flame but does not stay lit

I set the dryer on a dry setting then after it lights it will only stay on for about 3 seconds after that i try to restart it without selecting the dry cycle again and it will not start i mean the flame sensor and igniter wont glow at all until i reselect the dry setting then it will glow and ignite the gas but only about 3 seconds the goes out again i guessing that my coil are bad and i am not 100% sure any ideas on how to test the dryer coils to be sure or could something else be causing the problem?