콘솔워크

Appium 연결 테스트 본문

프로그래밍/python

Appium 연결 테스트

이휘재123 2023. 2. 17. 18:42
반응형

[준비물]

일단 ADB설정부터 마치고 와야함

https://uipath.tistory.com/279

 

[adb] android의 크롬을 개발자 도구(F12)로 확인해보기

아래의 글을 참고하여 adb device 설정까지 마쳐야 함 https://uipath.tistory.com/230 [adb] python 안드로이드 스마트폰 제어하기 1. 스마트폰과 연결하기 위해 구글 개발자 페이지에서 adb (android device bridge)를

uipath.tistory.com

 

appium 클라이언트도 깔아야 함

https://appium.io/

 

Appium: Mobile App Automation Made Awesome.

Appium Philosophy Appium is built on the idea that testing native apps shouldn't require including an SDK or recompiling your app. And that you should be able to use your preferred test practices, frameworks, and tools. Appium is an open source project and

appium.io

 

JAVA_HOME 환경변수 추가

-> 본인은 jdk-19를 다운받아서 진행함

 

 

안드로이드 SDK 설치 후 ANDROID_HOME 환경변수 추가

안드로이드 스튜디오 설치 시 나오는 sdk의 기본 경로

그 후 Path에도 추가

-> C:\Users\name\AppData\Local\Android\Sdk

 

 

 

 

 

 

Appium Server GUI.exe 실행

 

 

 

 

이렇게 입력하고 startServer

 

 

 

이렇게 화면을 띄워놓고 파이썬으로...

 

 

 

pip install Appium-Python-Client

설치

 

 

 

from appium import webdriver

desired_caps = {}
desired_caps["platformName"] = "Android"
desired_caps["platformVersion"] = "9"
desired_caps["deviceName"] = "BH902A48BZ"
desired_caps["browserName"] = "Chrome"

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

driver.get("https://www.naver.com")

위와 같이 파이썬 코드 작성하고 실행

버전과 기종은 알아서 맞출것

 

 

내 기종은 이거고 버전은 9임

 

 

chrome://inspect/#devices

여기서 모바일 크롬 디버그 가능

 

 

 

반응형