Help with Python Appium iOS Test Script for Opening Settings and Clicking Buttons
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu với Appium Python Quickstart được liên kết và script TestIOSSettings được cung cấp, sau đó tái hiện việc khởi chạy Settings và tương tác với Screen Time trên iPhone 15 được nêu, chạy iOS 17.2. Được xem là hoàn thành khi đã ghi lại hướng dẫn đáng tin cậy về cách mở Settings, tương tác với các điều khiển của ứng dụng và phân biệt giữa việc khởi chạy ứng dụng mới với việc gắn vào một ứng dụng hiện có.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hi Appium team,
I’m trying to create a Python test script for iOS using Appium. I followed the Quickstart example for Android, but when I adapted it to an emulated iPhone device, I ran into a few issues.
Currently, I want to:
- Open the iOS Settings app.
- Click a specific button or section (e.g., "Screen Time").
- Assert a certain text exists.
- Understand how to control app launch behavior in Appium:
4a. Start an app fresh: Launch the app as if it has never been opened before on the device (no cached state, fresh session).
4b. Attach to an already running app: Connect to the app if it’s already running on the emulator or device, without restarting it.
import unittest
import warnings
from appium import webdriver
from appium.options.ios import XCUITestOptions
from appium.webdriver.common.appiumby import AppiumBy
options = XCUITestOptions()
options.platform_name = "iOS"
options.automation_name = "XCUITest"
options.device_name = "iPhone 15"
options.platform_version = "17.2"
options.bundle_id = "com.apple.Preferences"
options.language = "en"
options.locale = "US"
# options.device_id = "1F4F5697-3E82-4EC9-819A-9478BDE3E598"
appium_server_url = "http://127.0.0.1:4723"
class TestIOSSettings(unittest.TestCase):
def setUp(self) -> None:
self.driver = webdriver.Remote(command_executor=appium_server_url, options=options)
def tearDown(self) -> None:
if self.driver:
self.driver.quit()
def test_open_screen_time(self) -> None:
el = self.driver.find_element(AppiumBy.IOS_PREDICATE, 'label == "Screen Time"')
el.click()
if __name__ == "__main__":
unittest.main()
Problems I encountered:
- I cannot navigate into Settings reliably; nothing is happening on the emulated iPhone screen.
- I’m unsure how to launch an app fresh vs attach to an already running app.
Could you provide guidance on:
- The correct way to open system apps like Settings and interact with buttons.
- How to launch an app from scratch or attach to an existing session.
Any tips for using iOS emulators specifically with Python/Appium.
Thanks in advance!
Best regards,
Alex
- Ngôn ngữ chính
- Python
- Star
- 1.8k
- Fork
- 570
- Merge trung bình
- 1 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 24
Chuẩn bị môi trường
Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của appium/python-client
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
appium/python-client#1230 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 55/100
appium/python-client#1147 · 7 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
appium/python-client#1091 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
appium/python-client#1076 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 20/100
appium/python-client#980 · 7 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của appium/python-client
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
gradio-app/gradio#13895 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
build-error
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
spack/spack-packages#6713 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Use issue templates Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ActivityWatch/activitywatch#1464 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: The ckg tool drops the return type of every decorated Python method in class search results Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
bytedance/trae-agent#483 ·
Maintainer thường phản hồi trong vòng 1 ngày