#NEWLINE# def test_MAC_switchAndClose_successful( self ) : #NEWLINE# #INDENT# self . assertFalse ( self . am . _cache . current ) #NEWLINE# self . am . open_application ( 'http://127.0.0.1:4723/wd/hub' , alias = 'MyAppA' , platformName = 'Android' , platformVersion = '4.4' , deviceName = 'MyDevice01' ) #NEWLINE# self . am . open_application ( 'http://127.0.0.1:4733/wd/hub' , alias = 'MyAppB' , platformName = 'Android' , platformVersion = '4.4' , deviceName = 'MyDevice02' ) #NEWLINE# self . am . open_application ( 'http://127.0.0.1:4743/wd/hub' , alias = 'MyApp3' , platformName = 'Android' , platformVersion = '4.4' , deviceName = 'MyDevice03' ) #NEWLINE# self . am . switch_application ( 2 ) #NEWLINE# self . am . close_application ( ) #NEWLINE# self . am . switch_application ( 3 ) #NEWLINE# self . assertRegexpMatches ( self . am . _cache . current . _appiumUrl , '127.0.0.1:4743' ) #NEWLINE# self . assertEqual ( self . am . _cache . current . _desCapa . get ( 'deviceName' ) , 'MyDevice03' ) #NEWLINE# appIndex = self . am . open_application ( 'http://127.0.0.1:4753/wd/hub' , alias = 'MyAppD' , platformName = 'Android' , platformVersion = '4.4' , deviceName = 'MyDeviDce04' ) #NEWLINE# self . assertEqual ( appIndex , 4 ) #NEWLINE# appIndex = self . am . switch_application ( 'MyAppA' ) #NEWLINE# self . assertRegexpMatches ( self . am . _cache . current . _appiumUrl , '127.0.0.1:4723' ) #NEWLINE# self . assertEqual ( self . am . _cache . current . _desCapa . get ( 'deviceName' ) , 'MyDevice01' )