Hello I’m trying to find a way to check a checkbox after verifying that the checkbox is not checked.
I got appium to access the device’s Display settings and I’m trying to make it so that the screen won’t auto-rotate.
Also, I got it to find the element with the text “Auto-rotate screen”, but I wasn’t sure how to actually select the “CheckBox” element that is associated with “Auto-rotate screen” option…
def setUp(self):
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '4.4.4'
desired_caps['deviceName'] = 'Android Device'
desired_caps['appPackage'] = 'com.android.settings'
desired_caps['appActivity'] = 'com.android.settings.Settings'
self.driver = webdriver.Remote(
'http://localhost:4723/wd/hub', desired_caps)
def tearDown(self):
self.driver.quit()
def test_config_display(self):
self.driver.find_element_by_android_uiautomator(
'new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().text("Display").instance(0));').click()
auto_rotate = self.driver.find_element_by_android_uiautomator('new UiSelector().text("Auto-rotate screen")')
I’d appreciate any help, thanks.