微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Appium-Active Element(有源条件)

Get Active Element


Gets the active element of the current session //获取当前会话的活动元素

Example Usage
JavaWebElement currentElement = driver.switchTo().activeElement();
Pythonelement = driver.switch_to.active_element
Javascript// webdriver.io example
driver.getActiveElement();

// wd example
let element = await driver.active();
Ruby# ruby_lib example
switch_to.active_element

# ruby_lib_core example
@driver.switch_to.active_element
C#IWebElement currentElement = driver.SwitchTo().ActiveElement();
PHP// Todo PHP sample
Description

The submit command may also be applied to any element that is a descendant of a FORM element (Web only) //submit命令还可以应用于作为表单元素的后代的任何元素(仅限Web)

Support
Appium Server
PlatformDriverPlatform VersionsAppium VersionDriver Version
iOSXCUITestNoneNoneNone
UIAutomation8.0 to 9.3AllAll
AndroidEspresso?+1.9.0+All
UiAutomator2?+1.6.0+All
UiAutomator4.3+AllAll
MacMac?+1.6.4+All
WindowsWindows10+1.6.0+All
Appium Clients
LanguageSupportDocumentation
JavaAllseleniumhq.github.io
PythonAllselenium-python.readthedocs.io
Javascript (WebdriverIO)All
Javascript (WD)Allgithub.com
RubyAllwww.rubydoc.info
PHPAllgithub.com
C#Allgithub.com
HTTP API Specifications
Endpoint

GET /session/:session_id/element/:element_id/equals/:other_element_id

URL Parameters
namedescription
session_idID of the session to route the command to
element_idID of the element
element_idID of the other element to check if they’re equal
JSON Parameters

None

Response

Whether the two ID’s refer to the same element (boolean) //两个ID是否引用同一元素(布尔值)

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐