💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/selected.yml) # 元素被选中 确定表单元素(如复选框, 选择框等)被选中 [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/selected.yml) ## 样例 ```java // Java MobileElement element = (MobileElement) driver.findElementByAccessibilityId("SomeAccessibilityID"); boolean isSelected = element.isSelected(); ``` ```python # Python self.driver.find_element_by_accessibility_id('SomeAccessibilityID').is_selected() ``` ```javascript // Javascript // webdriver.io example let isSelected = $("~SomeAccessibilityId").isSelected(); // wd example let element = await driver.elementByAccessibilityId("SomeAccessibilityID"); let isSelected = await element.isSelected(); ``` ```ruby # Ruby # ruby_lib example find_element(:accessibility_id, "SomeAccessibilityID").selected? # ruby_lib_core example @driver.find_element(:accessibility_id, "SomeAccessibilityID").selected? ``` ```php # PHP // TODO PHP sample ``` ```csharp // C# var element = driver.FindElementByAccessibilityId("SomeAccessibilityID"); bool isSelected = element.Selected; ``` [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/selected.yml) ## 支持 [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/selected.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/selected.yml) ### Appium Clients |语言|支持|文档| |--------|-------|-------------| |[Java](https://github.com/appium/java-client/releases/latest)| All | [seleniumhq.github.io](https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/WebElement.html#isSelected--) | |[Python](https://github.com/appium/python-client/releases/latest)| All | [selenium-python.readthedocs.io](http://selenium-python.readthedocs.io/api.html#selenium.webdriver.remote.webelement.WebElement.is_selected) | |[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#L1402) | |[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/Element#selected%3F-instance_method) | |[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) | |[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/AppiumWebElement.cs) | [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/selected.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/selected.yml) ### 端点 `GET /session/:session_id/element/:element_id/selected` [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/selected.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/selected.yml) ### JSON 参数 无 [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/selected.yml) ### 响应 元素是否被选中 (布尔型) [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/selected.yml) ## 另请参见 * [W3C Specification](https://www.w3.org/TR/webdriver/#dfn-is-element-selected) * [JSONWP Specification](https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidselected)