I'm new to python with android. I need to write python script. basically what I want to do is when you click first view, I need to load second view. second view has button, when it press that I need to load third view.
class SimpleAndroidTests(unittest.TestCase):
def setUp(self):
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '4.2'
desired_caps['deviceName'] = 'Android Emulator'
desired_caps['app'] = PATH(
'mypath/aaa.apk'
)
desired_caps['appPackage'] = 'com.xxxx'
self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
def test_find_elementsFirstview(self):
time.sleep(13)
textfields = self.driver.find_elements_by_class_name("android.widget.EditText")
textfields[0].send_keys("first text")
textfields[1].send_keys("second text")
el = self.driver.find_element_by_name("press Login")
el.click()
def test_secondView(self):
time.sleep(10)
textfields = self.driver.find_elements_by_class_name("android.widget.EditText")
textfields[2].send_keys("secondviewinput2")
def tearDown(self):
# end the session
self.driver.quit()
if __name__ == '__main__':
suite = unittest.TestLoader().loadTestsFromTestCase(SimpleAndroidTests)
unittest.TextTestRunner(verbosity=2).run(suite)
ISSUE is it is not entering to the second view. It is re-loding first view again. please help...