Skip to content

Commit

Permalink
Criando script inicial
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicasv committed Sep 9, 2022
0 parents commit e3eb647
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/TesteMobile.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
from appium import webdriver
from appium.webdriver.common.appiumby import AppiumBy

caps = {}
caps["platformName"] = "Android"
caps["appium:platformVersion"] = "9.0"
caps["browserName"] = ""
caps["appium:appiumVersion"] = "1.22.0"
caps["appium:deviceName"] = "Samsung Galaxy S9 FHD GoogleAPI Emulator"
caps["appium:deviceOrientation"] = "portrait"
caps["appium:app"] = "storage:filename=Calculator_v8.2 (453324893)_apkpure.com.apk"
caps["appium:appPackage"] = "com.google.android.calculator"
caps["appium:appActivity"] = "com.android.calculator2.Calculator"
caps["appium:ensureWebviewsHavePages"] = True
caps["appium:nativeWebScreenshot"] = True
caps["appium:newCommandTimeout"] = 0
caps["appium:connectHardwareKeyboard"] = True


if __name__ == '__main__': #aciona o script

driver = webdriver.Remote("https://jessicav:2e5baf84-44d4-46bc-ac27-f191c5bff9fa@ondemand.us-west-1.saucelabs.com:443/wd/hub", caps)

# o script gerado automaticamente pelo appium não funcionou como demonstrado no vídeo pelo professor.
# revirei na internet e descobri que a sintaxe mudou um pouco
# antes se usava driver.find_element_by_accessibility_(etc) e agora é como coloquei abaixo

el1 = driver.find_element(AppiumBy.ACCESSIBILITY_ID,'8')
el1.click()
el2 = driver.find_element(AppiumBy.ACCESSIBILITY_ID, 'plus')
el2.click()
el3 = driver.find_element(AppiumBy.ACCESSIBILITY_ID,'5')
el3.click()
el4 = driver.find_element(AppiumBy.ACCESSIBILITY_ID, 'equals')
el4.click()
el5 = driver.find_element(AppiumBy.ID, 'com.google.android.calculator:id/result_final')
el5.click()

driver.quit()

0 comments on commit e3eb647

Please sign in to comment.