Get Active Element
Gets the active element of the current session //获取当前会话的活动元素
Example Usage
Java | WebElement currentElement = driver.switchTo().activeElement(); |
Python | element = 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
Platform | Driver | Platform Versions | Appium Version | Driver Version |
---|---|---|---|---|
iOS | XCUITest | None | None | None |
UIAutomation | 8.0 to 9.3 | All | All | |
Android | Espresso | ?+ | 1.9.0+ | All |
UiAutomator2 | ?+ | 1.6.0+ | All | |
UiAutomator | 4.3+ | All | All | |
Mac | Mac | ?+ | 1.6.4+ | All |
Windows | Windows | 10+ | 1.6.0+ | All |
Appium Clients
Language | Support | Documentation |
---|---|---|
Java | All | seleniumhq.github.io |
Python | All | selenium-python.readthedocs.io |
Javascript (WebdriverIO) | All | |
Javascript (WD) | All | github.com |
Ruby | All | www.rubydoc.info |
PHP | All | github.com |
C# | All | github.com |
HTTP API Specifications
Endpoint
GET /session/:session_id/element/:element_id/equals/:other_element_id
URL Parameters
name | description |
---|---|
session_id | ID of the session to route the command to |
element_id | ID of the element |
element_id | ID 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 举报,一经查实,本站将立刻删除。