File tree Expand file tree Collapse file tree 1 file changed +1
-18
lines changed
packages/side-runtime/src Expand file tree Collapse file tree 1 file changed +1
-18
lines changed Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments