Adding new switchWindow() functionality, and fixing sample functional test to show the framework