Skip to content

Commit b6eca15

Browse files
coinzdudetoddtarsi
authored andcommitted
remove frame url fallback matching code, no longer needed
1 parent 4be76cf commit b6eca15

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

packages/side-runtime/src/webdriver.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -317,24 +317,7 @@ export default class WebDriverExecutor {
317317
const frameTargets = frameIndex.split('\\')
318318
for (let frameTarget of frameTargets) {
319319
if (frameTarget === '..') await targetLocator.parentFrame()
320-
else {
321-
const frameIndex = locator.substring('index='.length)
322-
// Delay for a second. Check too fast, and browser will think this iframe location is 'about:blank'
323-
await new Promise((f) => setTimeout(f, 1000))
324-
const frameUrl = await this.driver.executeScript(
325-
"return window.frames['" + frameIndex + "'].location.href"
326-
)
327-
const windowFrames = await this.driver.findElements(By.css('iframe'))
328-
let matchIndex = 0
329-
for (let frame of windowFrames) {
330-
let localFrameUrl = await frame.getAttribute('src')
331-
if (localFrameUrl === frameUrl) {
332-
break
333-
}
334-
matchIndex++
335-
}
336-
this.driver.switchTo().frame(matchIndex)
337-
}
320+
else await targetLocator.frame(Number(frameTarget))
338321
}
339322
} else {
340323
const element = await this.waitForElement(locator)

0 commit comments

Comments
 (0)