def test_swith_between_webapps(self): setUp() testapp = TestApp(device, ConstPath + "/../iterative.apk", "org.xwalk.iterative", "IterativeActivity") switchapp = TestApp(device, ConstPath + "/../switchapp.apk", "org.xwalk.switchapp", "SwitchappActivity") try: if not testapp.isInstalled(): testapp.install() if not switchapp.isInstalled(): switchapp.install() testapp.launch() # Pause and Resume 50 times for i in range(50): time.sleep(2) # swtich to other webapp self.assertTrue(testapp.switchTo(switchapp)) time.sleep(2) # swtich back self.assertTrue(testapp.switch()) testapp.stop() switchapp.stop() except Exception as e: print "Error: %s" % e testapp.stop() switchapp.stop() self.assertTrue(False)