Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

appium 是否实现CSS定位 #7

Closed
781412862 opened this issue Sep 23, 2019 · 2 comments
Closed

appium 是否实现CSS定位 #7

781412862 opened this issue Sep 23, 2019 · 2 comments

Comments

@781412862
Copy link

selenium.common.exceptions.WebDriverException: Message: Method is not implemented

请问appium是否实现使用CSSElement定位

@781412862
Copy link
Author

from poium import Page, PageElement,CSSElement
from appium import webdriver

class CalculatorPage(Page):
inpt_1 = CSSElement("input[placeholder="请输入手机号"]")
inpt_2 = CSSElement("#login_password")
add = CSSElement("#btn_login2mode")

APP定义运行环境

desired_caps = {

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

page = CalculatorPage(driver)
page.inpt_1.click()
page.inpt_2.click()
page.add.click()
driver.quit()

@defnngj
Copy link
Collaborator

defnngj commented Sep 23, 2019

appium 不支持 find_element_by_css_selector() 定位, 在App中是通过布局文件(xml)来实现界面,web是通过HTML实现的页面,两者本身存在差异,所以,App不支持CSS语法的定位。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants