Appium으로 테스트하기 (2) - 에러 핸들링

garaming·2023년 11월 23일
0

automation

목록 보기
4/6

Error 핸들링

1. MobileBy 오류

Appium에서 사용할 수 있는 Locator 클래스 중 MobileByappium-python-client v2.8.1 기준으로 Deprecated 되어 발생한 에러.

class MobileBy(AppiumBy):
    """
    deprecated:: 2.1.0
        Please use 'from appium.webdriver.common.appiumby import AppiumBy' instead of 'MobileBy'.
    """

해결 방법은 두가지
(1) MobileBy -> AppiumBy로 수정
(3) appium-python-client 다운 그레이드


2. NotOpenSSLWarning 오류

NotOpenSSLWarning: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'.

스택오버플로우로 아래 명령어 수행하여 해결

brew install openssl@1.1
pip install urllib3==1.26.6

3. TypeError: __init__() got an unexpected keyword argument 'desired_capabilities'

킹식문서를 잘 보자!!!!

스택오버플로우 참고하면 'desired_capabilities' has been removed from the __init__() 라는 것을 알 수 있음.
따라서 아래와 같이 버전을 수정하여 해결함

pip3 install Appium-Python-Client==2.6.2
pip3 install selenium==4.15.0

버전 관리 관련 공식문서

4. [경로 에러 : 파이썬] FileNotFoundError

FileNotFoundError: [Errno 2] No such file or directory

같은 경로 내에 위치한 파일이어도 현재 실행하는 파이썬 파일과 import 하려는 파일 위치가 달라서 생기는 버그

터미널에서 현재 실행하는 파이썬의 위치로 수정해준다.

profile
Connecting the dots

0개의 댓글