I did try the WIn32::GUITest in place of the sleep but the session went away.
Based on what you have said about keeping the session in scope is more than likely the probelm but I am not sure how to do this, a failing on my part to really understanding variable scoping.