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

Method execute

javascript/selenium-webdriver/lib/script.js:125–139  ·  view source on GitHub ↗
(script, ...args)

Source from the content-addressed store, hash-verified

123 }
124
125 async execute(script, ...args) {
126 await this.#initScript()
127
128 const browsingContextId = await this.#driver.getWindowHandle()
129
130 const argumentList = []
131
132 args.forEach((arg) => {
133 argumentList.push(LocalValue.getArgument(arg))
134 })
135
136 const response = await this.#script.callFunctionInBrowsingContext(browsingContextId, script, true, argumentList)
137
138 return response.result
139 }
140}
141
142module.exports = Script

Calls 5

#initScriptMethod · 0.95
getWindowHandleMethod · 0.65
forEachMethod · 0.45
getArgumentMethod · 0.45