Skip to content

CEAC33/appium-with-python-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 

Repository files navigation

appium-with-python-tutorial

Appium

Android Verison History

Screen Shot 2022-01-02 at 16 20 26

Pre-requisite for Windows and MAC OSX:

brew install android-platform-tools

Useful mirroring tool for Android devices

brew install scrcpy

Connect your cellphone to the PC and run the command

scrcpy

Intro

Updating to Appium 2.0 Python client

pip install Appium-Python-Client==2.1.2
from appium import webdriver
import time

desired_caps = dict(
    deviceName="Android",
    platformName="Android",
    browserName="Chrome"
)

driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", desired_caps)

driver.get("http://google.com")
print(driver.title)
time.sleep(2)
driver.quit()

Different ways to starting appium server

Automating Native Apps

Automating Dialer App - Making a phone call

adb devices
adb shell
dumpsys window windows | grep -E 'mTopActivityComponent'
from appium import webdriver
import time

desired_caps = dict(
    deviceName="Android",
    platformName="Android",
    appPackage="com.android.dialer",
    appActivity=".BBKTwelveKeyDialer"
    
)

driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", desired_caps)

time.sleep(2)
driver.quit()
from appium import webdriver
import time

desired_caps = dict(
    deviceName="Android",
    platformName="Android",
    appPackage="com.zhiliaoapp.musically",
    appActivity="com.ss.android.ugc.aweme.main.MainActivity"
    
)

driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", desired_caps)

time.sleep(2)
driver.quit()

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published