본문 바로가기

자동화14

appium 실행 시, 기기 연결이 안되는 경우 exited with code 1'; Command output: adb: device unauthorized. This adb server's $ADB_VENDOR_KEYS is not set Try 'adb kill-server' if that seems wrong. Otherwise check for a confirmation dialog on your device. 위 에러 메시지가 노출되면서 연결이 안되는 경우 안드로이드 기기 > 개발자 옵션 > 기본 USB 구성에서 "파일 전송/Android Auto" 로 기본 설정 되어있을 확률이 높다. 이를 "USB 테더링" 으로 변경해주면, USB 디버깅 허용 얼럿이 뜨면서 정상 연결된다. 이후 adb devices 명령어 실행시, 연결 확인~ https.. 2024. 3. 3.
appium 자동화 2024 - 6) Git 레파지토리 생성 > 로컬 프로젝트 업로드 하기 brew install git 맥 터미널 git 설치 https://github.com/ GitHub: Let’s build from here GitHub is where over 100 million developers shape the future of software, together. Contribute to the open source community, manage your Git repositories, review code like a pro, track bugs and fea... github.com 1. github 회원가입 2. 오른쪽 상단 프로필 파일 > Your repositories > New 로 레파지토리 생성 3. 맥 터미널 > 기존에 만들어둔 프로젝트로 위치 후 깃 레파지토.. 2024. 3. 3.
appium 자동화 2024 - 5) 소스 코드 구조화 이전에 짰던 하나의 소스코드를 구조화 import pytest from appium import webdriver from appium.options.android import UiAutomator2Options from selenium.common import TimeoutException from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from appium.webdriver import WebElement from selenium.webdriver.support.wait import WebDriverWait # 1. 기다렸다가 클릭하는 함수 wait_Ele.. 2024. 2. 22.
appium 자동화 2024 - 4) Pytest+appium 자동화 구현 1. Appium 실행 맥 터미널 > appium 앱피움 실행 확인 2. Appium Inspector ㄴ 우선 가장 기본적인 세팅값 설정 후, 하단 Start Session 클릭 ㄴ 미러링이 되며, 각 Element 를 선택할수 있게된다. ㄴ 시계를 실행시키기 위해, 시계 아이콘을 선택하면 위와같이 Element 정보가 노출된다. ㄴ 위에서 xpath 값을 복사해둔다. //android.widget.TextView[@content-desc="시계"] 3. Python 소스코드 앞서 설치 했던 Pytest 테스트 포맷으로 통해 소스코드를 작성한다. 구조화 되기 전 단일 코드로 작성하는 단계 import pytest from appium import webdriver from appium.options.a.. 2024. 2. 21.
appium 자동화 2024 - 3) Pytest 예제 https://docs.pytest.org/en/7.4.x/getting-started.html pip install -U pytest ㄴ 맥 터미널에서 설치 성공 # content of test_sample.py def func(x): return x + 1 def test_answer(): assert func(3) == 5 ㄴ 코드 입력 후 ㄴ pytest 테스트파일.py 명령어로 간단하게 테스트 동작 확인. https://salzzak.tistory.com/95 미국식 의료 개그 만화 1 salzzak.tistory.com 2024. 2. 20.
appium 자동화 2024 - 2) Write the Test(Python/Pytest) 우선 Pycharm 을 설치하고 간단하게 동작하는지도 확인ㄴ 잘 동작한다. https://appium.io/docs/en/2.4/quickstart/test-py/ 위 페이지에 있는 코드를 복붙해보자.# test.py import unittest from appium import webdriver from appium.options.android import UiAutomator2Options from appium.webdriver.common.appiumby import AppiumBy capabilities = dict( platformName='Android', automationName='uiautomator2', deviceName='Android', appPackage='com.android... 2024. 2. 20.
appium 자동화 2024 - 1) 기본 세팅 (Appium/UiAutomator2/Appium Inspector) * 현재는 Android 기준으로 작성, iOS 세팅 내용 추가 예정Install Appium https://brew.sh/ https://appium.io/docs/en/2.4/quickstart/install 맥 터미널에 입력/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 설치 내용 마지막 쯤에 있는 Next steps 명령어를 복붙해서 실행brew install npmㄴ brew > npm 설치 npm i -g appiumㄴ npm > appium 설치 Install the UiAutomator2 Driverhttps://appium.io/docs/en/2.4/quickstar.. 2024. 2. 20.
2022 자동화 세팅을 차근차근 해보자 3) Appium Inspector 설치 & And 연동 Appium Inspector 설치 & And 연동 지금은 왜인지 Appium과 따로 받아야 하는것 같다. (Appium 1.22.2 기준) https://github.com/appium/appium-inspector/releases 1.22.2 기준으로 Appium Server 실행 후, And 기기연결 (adb devices로 연결 확인) Remote Path > /wd/hub 입력 { "appium:deviceName": "Galaxy A10e", // 기기에서 확인 가능 "appium:udid": "RF9N706DF6L", // adb devices 명령어로 확인 가능 "platformName": "Android", "appium:platformVersion": "10", // 기기에서 확인 가능.. 2022. 3. 13.
2022 자동화 세팅을 차근차근 해보자 2) Mac OS에 실제 Android 기기 연결 1. JAVA 설치 java -version / javac -version > 미설치 확인 https://www.oracle.com/java/technologies/downloads/ > 다운로드 후 설치 vim ~/.bash_profile export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_321.jdk/Contents/Home 입력 후 저장 2. Android SDK 설치 brew cask install android-sdk platform-tools folder 압축풀기 https://developer.android.com/studio/command-line/sdkmanager 여기서 복사해오자 sdkmanager "platform-tools".. 2022. 3. 13.
2022 자동화 세팅을 차근차근 해보자 1) Appium 설치 Appium 설치 1) hoewbrew 설치 https://brew.sh/ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 2) node.js 설치 node --version / npm --version > 둘다 미설치 확인 후 brew install node zsh: command not found: brew 오류 발생 시 vi ~/.zshrc export PATH=/opt/homebrew/bin:$PATH 작성 후 ESC > :wq! 입력 source ~/.zshrc 설치 완료 후 node --version / npm --version 으로 설치 확인 3) appium 설치 np.. 2022. 3. 13.