Best Python code snippet using robotframework-appiumlibrary_python
test_multipleAppiumConnections.py
Source:test_multipleAppiumConnections.py
...104 # create 2nd application - alias=MyAppB - index=2105 self.am.open_application('http://127.0.0.1:4733/wd/hub', alias='MyAppB', platformName='Android', platformVersion='4.4', deviceName='MyDevice02') 106 # switch to non-existent alias107 self.assertRaisesRegexp(RuntimeError, "Non-existing.*MyAppXXX", self.am.switch_application, 'MyAppXXX')108 def test_MAC_switchWithIndex_successful(self):109 # switch applications with indices110 self.assertFalse(self.am._cache.current)111 # create 1st application - alias=MyAppA - index=1112 self.am.open_application('http://127.0.0.1:4723/wd/hub', alias='MyAppA', platformName='Android', platformVersion='4.4', deviceName='MyDevice01')113 # create 2nd application - alias=MyAppB - index=2114 self.am.open_application('http://127.0.0.1:4733/wd/hub', alias='MyAppB', platformName='Android', platformVersion='4.4', deviceName='MyDevice02') 115 # switch to 1st application - index=1 - appIndex=2 (switch_application returns the previous app index)116 appIndex = self.am.switch_application(1)117 self.assertRegexpMatches(self.am._cache.current._appiumUrl, '127.0.0.1:4723')118 self.assertEqual(self.am._cache.current._desCapa.get('deviceName'), 'MyDevice01')119 self.assertEqual(appIndex, 2)120 self.am.lock()121 # create 3rd application - alias=MyAppC - index=3122 self.am.open_application('http://127.0.0.1:4743/wd/hub', alias='MyAppC', platformName='Android', platformVersion='4.4', deviceName='MyDevice03') ...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!