Created
January 14, 2021 05:10
-
-
Save bbchriscesar/5038d3e46f3046ce5b95646a7cfdd9ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
from appium import webdriver | |
import time | |
@pytest.mark.parametrize("udid, systemPort", [ | |
("FA7BN1A04058", "8201"), | |
("FA7BN1A04086", "8202") | |
] | |
) | |
def test_SettingsTestCase(udid, systemPort): | |
capabilities = { | |
'platformName': 'Android', | |
'deviceName': 'Pixel 2', | |
'appPackage': 'com.android.settings', | |
'appActivity': '.Settings', | |
'udid': udid, | |
'systemPort': systemPort, | |
'automationName': 'UiAutomator2', | |
'noReset': True, | |
} | |
url = 'http://localhost:4723/wd/hub' | |
driver = webdriver.Remote(url, capabilities) | |
try: | |
for element in range(len(driver.find_elements_by_class_name("android.widget.RelativeLayout"))): | |
driver.find_elements_by_class_name("android.widget.RelativeLayout")[element].click() | |
time.sleep(1) | |
driver.back() | |
finally: | |
driver.quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment