Skip to content

Commit b65988b

Browse files
committed
Fix iFrame stuff
1 parent a7c7543 commit b65988b

File tree

4 files changed

+3
-10
lines changed

4 files changed

+3
-10
lines changed

lib/helper/WebDriver.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2568,13 +2568,6 @@ class WebDriver extends Helper {
25682568
*/
25692569
async switchTo(locator) {
25702570
this.browser.isInsideFrame = true
2571-
if (Number.isInteger(locator)) {
2572-
// @TODO construct array of iFrames and pick "index"
2573-
let locator1 = new Locator('//iframe[@id="number-frame-1234"]', 'xpath')
2574-
let res = await this._locate(locator1, true)
2575-
res = usingFirstElement(res)
2576-
return this.browser.switchFrame(res)
2577-
}
25782571
if (!locator) {
25792572
return this.browser.switchFrame(null)
25802573
}

test/helper/WebDriver.noSeleniumServer_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ describe('WebDriver - No Selenium server started', function () {
10131013
await wd.amOnPage('/iframe')
10141014
await wd.see('Iframe test', 'h1')
10151015
await wd.dontSee('Information', 'h1')
1016-
await wd.switchTo(0)
1016+
await wd.switchTo('iframe')
10171017
await wd.see('Information', 'h1')
10181018
await wd.dontSee('Iframe test', 'h1')
10191019
})

test/helper/WebDriver_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ describe('WebDriver', function () {
10361036
await wd.amOnPage('/iframe')
10371037
await wd.see('Iframe test', 'h1')
10381038
await wd.dontSee('Information', 'h1')
1039-
await wd.switchTo(0)
1039+
await wd.switchTo('iframe')
10401040
await wd.see('Information', 'h1')
10411041
await wd.dontSee('Iframe test', 'h1')
10421042
})

test/helper/webapi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,7 @@ module.exports.tests = function () {
13111311

13121312
await I.amOnPage('/iframe')
13131313
await I.resizeWindow(500, 700)
1314-
await I.switchTo(0)
1314+
await I.switchTo('iframe')
13151315

13161316
const { x, y } = await I.grabPageScrollPosition()
13171317
await I.scrollTo('.sign')

0 commit comments

Comments
 (0)