MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / constructor

Method constructor

javascript/selenium-webdriver/lib/select.js:148–164  ·  view source on GitHub ↗

* Create an Select Element * @param {WebElement} element Select WebElement.

(element)

Source from the content-addressed store, hash-verified

146 * @param {WebElement} element Select WebElement.
147 */
148 constructor(element) {
149 if (element === null) {
150 throw new Error(`Element must not be null. Please provide a valid <select> element.`)
151 }
152
153 this.element = element
154
155 this.element.getAttribute('tagName').then(function (tagName) {
156 if (tagName.toLowerCase() !== 'select') {
157 throw new Error(`Select only works on <select> elements`)
158 }
159 })
160
161 this.element.getAttribute('multiple').then((multiple) => {
162 this.multiple = multiple !== null && multiple !== 'false'
163 })
164 }
165
166 /**
167 *

Callers

nothing calls this directly

Calls 1

getAttributeMethod · 0.65

Tested by

no test coverage detected