from appium import webdriver
from time import sleep

from appium.webdriver.common.appiumby import AppiumBy
from selenium.webdriver.common.by import By

driver = webdriver.Remote(command_executor = ‘http://127.0.0.1:4723/wd/hub’,
desired_capabilities = {
“platformName”: “ios“,
appium:deviceName”: “iPhone Jeff”,
appium:platformVersion”: “16.5.1”,
appium:bundleId”: “welab.bank.mobile.stage”,
appium:udid“: “00008030-000A09C81A43802E”
})
sleep(10)

ele = driver.find_element(AppiumBy.IOS_PREDICATE,”name == ‘用戶名稱'”)
ele.send_keys(“qatest101″)
driver.find_element(By.ID,””)
sleep(2)

# 参考 External Libraries.site-packages.appium.webdriver.common.appiumby
class AppiumBy(By):
IOS_PREDICATE = ‘-ios predicate string
IOS_UIAUTOMATION = ‘-ios uiautomation’
IOS_CLASS_CHAIN = ‘-ios class chain’
ANDROID_UIAUTOMATOR = ‘-android uiautomator’
ANDROID_VIEWTAG = ‘-android viewtag
ANDROID_DATA_MATCHER = ‘-android datamatcher’
ANDROID_VIEW_MATCHER = ‘-android viewmatcher’
# Deprecated
WINDOWS_UI_AUTOMATION = ‘-windows uiautomation’
ACCESSIBILITY_ID = ‘accessibility id
IMAGE = ‘-image
CUSTOM = ‘-custom’

#参考selenium

class By:
“””Set of supported locator strategies.”””

ID = “id
XPATH = “xpath”
LINK_TEXT = “link text
PARTIAL_LINK_TEXT = “partial link text
NAME = “name
TAG_NAME = “tag name
CLASS_NAME = “class name
CSS_SELECTOR = “css selector”

原文地址:https://blog.csdn.net/qq_30273575/article/details/134556310

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。

如若转载,请注明出处:http://www.7code.cn/show_2075.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注