I am new to Python and trying to make an automation test for an application using Appium 1.3.1 and Python 3.6 on Android 7.1.1 simulator. At this point I am stuck at system permissions popup and don't know how to select "ALLOW" element with Python (not the same as selecting regular button inside the application). Application doesn't start until access to files is granted but I am not sure exactly where to set this in code and how to write it in Python. Does someone have some kind of sample code or some idea how to do this? This is what I have done so far:
import os
import unittest
from appium import webdriver
from time import sleep
class meTest(unittest.TestCase):
def setUp(self):
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '7.1.1'
desired_caps['deviceName'] = 'Android Emulator'
# Returns abs path relative to this file and not cwd
desired_caps['app'] = ‘example.apk'
self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
def test_OpenDocuments(self):
sleep(10)
documentSearchButton = self.driver.find_element_by_id(
‘example.example').click()
def tearDown(self):
self.driver.quit()
if __name__ == '__main__':
suite = unittest.TestLoader().loadTestsFromTestCase(meTest)
unittest.TextTestRunner(verbosity=2).run(suite)
Thanks.