MCPcopy Index your code
hub / github.com/SeleniumHQ/selenium / setFiles

Method setFiles

javascript/selenium-webdriver/bidi/input.js:86–103  ·  view source on GitHub ↗

* Sets the files property of a given input element. * * @param {string} browsingContextId - The ID of the browsing context. * @param {string | ReferenceValue} element - The ID of the element or a ReferenceValue object representing the element. * @param {string | string[]} files - The fil

(browsingContextId, element, files)

Source from the content-addressed store, hash-verified

84 * @returns {Promise<void>} A promise that resolves when the files are set.
85 */
86 async setFiles(browsingContextId, element, files) {
87 if (typeof element !== 'string' && !(element instanceof ReferenceValue)) {
88 throw Error(`Pass in a WebElement id as a string or a ReferenceValue. Received: ${element}`)
89 }
90
91 const command = {
92 method: 'input.setFiles',
93 params: {
94 context: browsingContextId,
95 element:
96 typeof element === 'string'
97 ? new ReferenceValue(RemoteReferenceType.SHARED_ID, element).asMap()
98 : element.asMap(),
99 files: typeof files === 'string' ? [files] : files,
100 },
101 }
102 await this.bidi.send(command)
103 }
104}
105
106async function updateActions(actions) {

Callers 1

Calls 3

ErrorFunction · 0.85
asMapMethod · 0.65
sendMethod · 0.65

Tested by

no test coverage detected