def test_swith_between_nativeandwebapp(self):
        setUp()
        testapp = TestApp(device, ConstPath + "/../iterative.apk",
                                "org.xwalk.iterative", "IterativeActivity")
        try:
            if not testapp.isInstalled():
                testapp.install()

            testapp.launch()
            # Pause and Resume 50 times
            for i in range(50):
                time.sleep(2)
                # swtich to native home app
                self.switchToHomeapp()
                self.assertFalse(testapp.isActivity())
                time.sleep(2)
                # swtich back
                self.assertTrue(testapp.switch())
            testapp.stop()
        except Exception as e:
            print "Error: %s" % e
            testapp.stop()
            self.assertTrue(False)