企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/location-in-view.yml) # 获取视图中的元素位置 Determine an element's location on the screen once it has been scrolled into view (mainly an internal command and not supported by all clients) [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/location-in-view.yml) ## 样例 ```java // Not supported ``` ```python # Python element = self.driver.find_element_by_accessibility_id('SomeAccessibilityID') element.location_in_view ``` ```javascript // Javascript // webdriver.io example let element = $("~SomeAccessibilityId") let location = driver.getElementLocationInView(element.elementId); // wd example let element = await driver.elementByAccessibilityId("SomeAccessibilityID"); let location = await element.getLocationInView(); ``` ```ruby # Not supported # Not supported ``` ```php // Not supported ``` ```csharp // Not supported ``` [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/location-in-view.yml) ## 支持 [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/location-in-view.yml) ### Appium Server |平台|Driver|平台版本|Appium版本|Driver版本| |--------|----------------|------|--------------|--------------| | iOS | [XCUITest](../../drivers/ios-xcuitest.md) | 9.3+ | 1.6.0+ | All | | | [UIAutomation](../../drivers/ios-uiautomation.md) | 8.0 to 9.3 | All | All | | Android | [Espresso](../../drivers/android-espresso.md) | ?+ | 1.9.0+ | All | | | [UiAutomator2](../../drivers/android-uiautomator2.md) | ?+ | 1.6.0+ | All | | | [UiAutomator](../../drivers/android-uiautomator.md) | 4.3+ | All | All | | Mac | [Mac](../../drivers/mac.md) | ?+ | 1.6.4+ | All | | Windows | [Windows](../../drivers/windows.md) | 10+ | 1.6.0+ | All | [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/location-in-view.yml) ### Appium Clients |语言|支持|文档| |--------|-------|-------------| |[Java](https://github.com/appium/java-client/releases/latest)| All | | |[Python](https://github.com/appium/python-client/releases/latest)| All | | |[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | | |[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2189) | |[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | | |[PHP](https://github.com/appium/php-client/releases/latest)| All | | |[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | | [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/location-in-view.yml) ## HTTP API规范 [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/location-in-view.yml) ### 端点 `GET /session/:session_id/elements/:element_id/location_in_view` [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/location-in-view.yml) ### URL参数 |名称|描述| |----|-----------| |session_id|发送命令用来会话的id| |element_id|获得视图中元素定位的id| [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/location-in-view.yml) ### JSON 参数 无 [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/location-in-view.yml) ### 响应 |名称|类型|描述| |----|----|-----------| | x | 数值类型 | X 坐标 | | y | 数值类型 | Y 坐标 | [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/location-in-view.yml) ## 另请参见 * [JSONWP Specification](https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidlocation_in_view)