-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Labels
Bug 🐛help wantedIssues that are free to take by anyone interestedIssues that are free to take by anyone interested
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
WebdriverIO Version
latest
Node.js Version
latest
Mode
WDIO Testrunner
Which capabilities are you using?
This fails in both standalone and WDIO test runner
capabilities: [{
browserName: 'chrome'
}]What happened?
When there is more than one frame that have the same src url, switching to the first frame works fine, however when switching to the second frame the element id gets swapped to the first frame and then the first frame is connected to instead.
What is your expected behavior?
Switching to a frame that has the same src as another frame should work properly.
How to reproduce the bug.
Here is a test case for producing the bug
import { expect, browser } from '@wdio/globals';
describe('Multiple frames with same src', () => {
it('should switch the the correct frame and properly set input values', async () => {
await browser.url('https://secure.lawpay.com/pages/wysekadishllp/operating');
await browser.$('.ap-accordion-check').click();
await browser.pause(2000);
let frames = await browser.$$('//iframe[contains(@title, "input field")]');
if (frames.length !== 2) {
throw new Error('expected two frames');
}
let firstFrame = frames[0]
let secondFrame = frames[1];
// First frame is credit card number field
let firstFrameId = firstFrame.elementId;
// Second frame is security code field
let secondFrameId = secondFrame.elementId;
// NOTE: Both frames have the same src url (likely the culprit)
// First frame properly set the value of the credit card field
await browser.switchFrame(firstFrame);
let firstInput = await browser.$('input');
await firstInput.setValue('123');
await browser.pause(2000);
await expect(firstInput).toHaveValue('123');
if (firstFrameId !== firstFrame.elementId) {
throw new Error('First Frame element was changed')
}
// Second frame sets the value of the credit card field, and the element id on the frame object changes to the first frame (bug)
await browser.switchFrame(null);
await browser.switchFrame(secondFrame);
let secondInput = await browser.$('input');
await secondInput.setValue('456');
await browser.pause(2000);
await expect(secondInput).toHaveValue('456');
if (secondFrameId !== secondFrame.elementId) {
throw new Error('Second Frame element was changed')
}
// If the check above is commented out, this will fail as the first frame input no longer has the value 123, but has 456
await browser.switchFrame(null);
await browser.switchFrame(firstFrame);
let firstInputSecondTry = await browser.$('input');
await browser.pause(2000);
await expect(firstInputSecondTry).toHaveValue('123');
})
})
Relevant log output
Execution of 1 workers started at 2025-04-17T22:51:43.272Z
2025-04-17T22:51:43.278Z INFO @wdio/cli:launcher: Run onPrepare hook
2025-04-17T22:51:43.278Z INFO @wdio/utils: Setting up browser driver for: chrome@stable
2025-04-17T22:51:43.279Z INFO @wdio/utils: Setting up browser binaries for: chrome@stable
2025-04-17T22:51:43.412Z INFO webdriver: Using Chromedriver v135.0.7049.96 from cache directory /var/folders/g_/8bjqys8d57b2pw2xs91fxl5m0000gp/T
2025-04-17T22:51:43.453Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2025-04-17T22:51:43.453Z INFO @wdio/local-runner: Start worker 0-0 with arg: run ./wdio.conf.js
[0-0] 2025-04-17T22:51:43.810Z INFO @wdio/local-runner: Run worker command: run
[0-0] RUNNING in chrome - file:///test/specs/test.e2e.js
[0-0] 2025-04-17T22:51:43.883Z INFO webdriver: Initiate new session using the WebDriver protocol
[0-0] 2025-04-17T22:51:44.009Z INFO webdriver: Using Chromedriver v135.0.7049.96 from cache directory /var/folders/g_/8bjqys8d57b2pw2xs91fxl5m0000gp/T
[0-0] 2025-04-17T22:51:44.022Z INFO chromedriver: Starting ChromeDriver 135.0.7049.96 (3504c18e3661c2f9d5de0685ccca27f593ad69c5-refs/branch-heads/7049@{#1837}) on port 56230
[0-0] 2025-04-17T22:51:44.023Z INFO chromedriver: Remote connections are allowed by an allowlist (0.0.0.0).
[0-0] 2025-04-17T22:51:44.023Z INFO chromedriver: Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
[0-0] 2025-04-17T22:51:44.033Z INFO chromedriver: ChromeDriver was started successfully on port 56230.
[0-0] 2025-04-17T22:51:45.016Z INFO @wdio/utils: Started Chromedriver v135.0.7049.96 with params --port=56230 --allowed-origins=* --allowed-ips=0.0.0.0 in 1050ms on port 56230
[0-0] 2025-04-17T22:51:45.019Z INFO webdriver: [POST] http://localhost:56230/session
[0-0] 2025-04-17T22:51:45.020Z INFO webdriver: DATA {
[0-0] capabilities: {
[0-0] alwaysMatch: {
[0-0] browserName: 'chrome',
[0-0] 'goog:chromeOptions': [Object],
[0-0] webSocketUrl: true,
[0-0] unhandledPromptBehavior: 'ignore'
[0-0] },
[0-0] firstMatch: [ {} ]
[0-0] }
[0-0] }
[0-0] 2025-04-17T22:51:46.045Z INFO webdriver: Register BiDi handler for session with id 67b798bf8e7ad1d9156af1f9982e51b9
[0-0] 2025-04-17T22:51:46.045Z INFO webdriver: Connecting to webSocketUrl ws://127.0.0.1:56230/session/67b798bf8e7ad1d9156af1f9982e51b9
[0-0] 2025-04-17T22:51:46.049Z INFO webdriver: Connected to Bidi protocol at ws://127.0.0.1:56230/session/67b798bf8e7ad1d9156af1f9982e51b9
[0-0] 2025-04-17T22:51:46.049Z INFO webdriver: Connected to WebDriver Bidi interface at ws://127.0.0.1:56230/session/67b798bf8e7ad1d9156af1f9982e51b9
[0-0] 2025-04-17T22:51:46.049Z INFO webdriver: BIDI COMMAND session.subscribe {"events":["browsingContext.contextCreated"]}
[0-0] 2025-04-17T22:51:46.050Z INFO webdriver: BIDI COMMAND session.subscribe {"events":["log.entryAdded","browsingContext.navigationStarted"]}
[0-0] 2025-04-17T22:51:46.050Z INFO webdriver: BIDI COMMAND script.addPreloadScript { functionDeclaration: <PreloadScript[1319 bytes]>, contexts: undefined }
[0-0] 2025-04-17T22:51:46.050Z INFO webdriver: BIDI COMMAND session.subscribe {"events":["browsingContext.navigationStarted","browsingContext.fragmentNavigated","network.responseCompleted","network.beforeRequestSent","network.fetchError"]}
[0-0] 2025-04-17T22:51:46.050Z INFO webdriver: BIDI COMMAND session.subscribe {"events":["browsingContext.userPromptOpened"]}
[0-0] 2025-04-17T22:51:46.050Z INFO webdriver: BIDI COMMAND session.subscribe {"events":["browsingContext.navigationStarted"]}
[0-0] 2025-04-17T22:51:46.051Z INFO webdriver: COMMAND getWindowHandle()
[0-0] 2025-04-17T22:51:46.051Z INFO webdriver: BIDI COMMAND browsingContext.getTree {}
[0-0] 2025-04-17T22:51:46.051Z INFO webdriver: [GET] http://localhost:56230/session/67b798bf8e7ad1d9156af1f9982e51b9/window
[0-0] 2025-04-17T22:51:46.052Z INFO webdriver: RESULT B077E668828B4B14255DEE615E443C47
[0-0] 2025-04-17T22:51:46.054Z INFO webdriverio:PolyfillManager: Adding polyfill script to context with id B077E668828B4B14255DEE615E443C47
[0-0] 2025-04-17T22:51:46.055Z INFO webdriver: BIDI COMMAND script.callFunction {"functionDeclaration":"<Function[442 bytes] webdriverioPolyfill>","target":{"children":null,"clientWindow":"","context":"B077E668828B4B14255DEE615E443C47","originalOpener":null,"parent":null,"url":"about:blank","userContext":"default"},"awaitPromise":false}
[0-0] 2025-04-17T22:51:46.055Z INFO webdriver: BIDI COMMAND script.addPreloadScript { functionDeclaration: <PreloadScript[442 bytes]>, contexts: ["B077E668828B4B14255DEE615E443C47"] }
[0-0] 2025-04-17T22:51:46.055Z INFO webdriver: BIDI RESULT {"id":1,"result":{"subscription":"f676150f-0789-48d2-a50c-7bc83821456e"},"type":"success"}
[0-0] 2025-04-17T22:51:46.055Z INFO webdriver: BIDI RESULT {"id":2,"result":{"subscription":"e3181526-8073-4a73-b9ed-d92b2a67401a"},"type":"success"}
[0-0] 2025-04-17T22:51:46.055Z INFO webdriver: BIDI RESULT {"id":4,"result":{"subscription":"73ee69c6-d9d4-473b-bd60-8b4250c4deeb"},"type":"success"}
[0-0] 2025-04-17T22:51:46.057Z INFO webdriver: BIDI RESULT {"id":5,"result":{"subscription":"bac56792-1b1b-4ba6-8819-bfd7d8b4082b"},"type":"success"}
[0-0] 2025-04-17T22:51:46.057Z INFO webdriver: BIDI RESULT {"id":6,"result":{"subscription":"91b6bef5-afda-43a5-8154-99218d1dbd71"},"type":"success"}
[0-0] 2025-04-17T22:51:46.057Z INFO webdriver: BIDI RESULT {"id":7,"result":{"contexts":[{"children":[],"clientWindow":"","context":"B077E668828B4B14255DEE615E443C47","originalOpener":null,"parent":null,"url":"about:blank","userContext":"default"}]},"type":"success"}
[0-0] 2025-04-17T22:51:46.059Z INFO webdriver: BIDI RESULT {"id":3,"result":{"script":"a1424f97-0b28-43b0-9b11-66bcd7279782"},"type":"success"}
[0-0] 2025-04-17T22:51:46.060Z INFO webdriver: BIDI COMMAND browsingContext.navigate {"context":"B077E668828B4B14255DEE615E443C47","url":"https://secure.lawpay.com/pages/wysekadishllp/operating","wait":"complete"}
[0-0] 2025-04-17T22:51:46.060Z INFO webdriver: BIDI RESULT {"id":8,"result":{"realm":"-568342365406781376.-3362283340654977078","result":{"type":"undefined"},"type":"success"},"type":"success"}
[0-0] 2025-04-17T22:51:46.060Z INFO webdriver: BIDI RESULT {"id":9,"result":{"script":"f430d70e-aee9-4f87-9643-26b5080b760e"},"type":"success"}
[0-0] 2025-04-17T22:51:47.056Z INFO webdriverio:PolyfillManager: Adding polyfill script to context with id 6A0DDA5581AF32EEC634CECF5584E862
[0-0] 2025-04-17T22:51:47.057Z INFO webdriver: BIDI COMMAND script.callFunction {"functionDeclaration":"<Function[442 bytes] webdriverioPolyfill>","target":{"children":null,"clientWindow":"","context":"6A0DDA5581AF32EEC634CECF5584E862","originalOpener":null,"parent":"B077E668828B4B14255DEE615E443C47","url":"about:blank","userContext":"default"},"awaitPromise":false}
[0-0] 2025-04-17T22:51:47.060Z INFO webdriver: BIDI COMMAND browsingContext.getTree {}
[0-0] 2025-04-17T22:51:47.060Z INFO webdriverio:PolyfillManager: Adding polyfill script to context with id F11C1A5C00C71606F20236D79C585A55
[0-0] 2025-04-17T22:51:47.060Z INFO webdriver: BIDI COMMAND script.callFunction {"functionDeclaration":"<Function[442 bytes] webdriverioPolyfill>","target":{"children":null,"clientWindow":"","context":"F11C1A5C00C71606F20236D79C585A55","originalOpener":null,"parent":"B077E668828B4B14255DEE615E443C47","url":"about:blank","userContext":"default"},"awaitPromise":false}
[0-0] 2025-04-17T22:51:47.060Z INFO webdriver: BIDI COMMAND browsingContext.getTree {}
[0-0] 2025-04-17T22:51:47.061Z INFO webdriver: BIDI RESULT {"id":12,"result":{"contexts":[{"children":[{"children":[],"clientWindow":"","context":"6A0DDA5581AF32EEC634CECF5584E862","originalOpener":null,"url":"about:blank","userContext":"default"},{"children":[],"clientWindow":"","context":"F11C1A5C00C71606F20236D79C585A55","originalOpener":null,"url":"about:blank","userContext":"default"}],"clientWindow":"","context":"B077E668828B4B14255DEE615E443C47","originalOpener":null,"parent":null,"url":"https://secure.lawpay.com/pages/wysekadishllp/operating","userContext":"default"}]},"type":"success"}
[0-0] 2025-04-17T22:51:47.061Z INFO webdriver: BIDI RESULT {"id":14,"result":{"contexts":[{"children":[{"children":[],"clientWindow":"","context":"6A0DDA5581AF32EEC634CECF5584E862","originalOpener":null,"url":"about:blank","userContext":"default"},{"children":[],"clientWindow":"","context":"F11C1A5C00C71606F20236D79C585A55","originalOpener":null,"url":"about:blank","userContext":"default"}],"clientWindow":"","context":"B077E668828B4B14255DEE615E443C47","originalOpener":null,"parent":null,"url":"https://secure.lawpay.com/pages/wysekadishllp/operating","userContext":"default"}]},"type":"success"}
[0-0] 2025-04-17T22:51:47.250Z INFO webdriverio:PolyfillManager: Adding polyfill script to context with id DD1349587F9AC83D5CD944CE34E9EF0C
[0-0] 2025-04-17T22:51:47.250Z INFO webdriver: BIDI COMMAND script.callFunction {"functionDeclaration":"<Function[442 bytes] webdriverioPolyfill>","target":{"children":null,"clientWindow":"","context":"DD1349587F9AC83D5CD944CE34E9EF0C","originalOpener":null,"parent":"B077E668828B4B14255DEE615E443C47","url":"about:blank","userContext":"default"},"awaitPromise":false}
[0-0] 2025-04-17T22:51:47.250Z INFO webdriver: BIDI COMMAND browsingContext.getTree {}
[0-0] 2025-04-17T22:51:47.362Z INFO webdriverio:PolyfillManager: Adding polyfill script to context with id A7DE75CF74627A86CE7295502398F87F
[0-0] 2025-04-17T22:51:47.363Z INFO webdriver: BIDI COMMAND script.callFunction {"functionDeclaration":"<Function[442 bytes] webdriverioPolyfill>","target":{"children":null,"clientWindow":"","context":"A7DE75CF74627A86CE7295502398F87F","originalOpener":null,"parent":"B077E668828B4B14255DEE615E443C47","url":"about:blank","userContext":"default"},"awaitPromise":false}
[0-0] 2025-04-17T22:51:47.364Z INFO webdriver: BIDI COMMAND browsingContext.getTree {}
[0-0] 2025-04-17T22:51:47.435Z INFO webdriver: BIDI RESULT {"error":"unknown error","id":11,"message":"execution contexts cleared","stacktrace":"Error\n at new UnknownErrorException (\u003Canonymous>:65:4860)\n at \u003Canonymous>:615:8569\n at \u003Canonymous>:1:271\n at Array.map (\u003Canonymous>)\n at Object.emit (\u003Canonymous>:1:254)\n at MapperCdpClient.emit (\u003Canonymous>:17:333)\n at #onMessage (\u003Canonymous>:824:2529)\n at WindowCdpTransport.window.cdp.onmessage (\u003Canonymous>:918:4707)\n at \u003Canonymous>:1:18","type":"error"}
[0-0] 2025-04-17T22:51:47.441Z INFO webdriver: BIDI RESULT {"error":"unknown error","id":13,"message":"execution contexts cleared","stacktrace":"Error\n at new UnknownErrorException (\u003Canonymous>:65:4860)\n at \u003Canonymous>:615:8569\n at \u003Canonymous>:1:271\n at Array.map (\u003Canonymous>)\n at Object.emit (\u003Canonymous>:1:254)\n at MapperCdpClient.emit (\u003Canonymous>:17:333)\n at #onMessage (\u003Canonymous>:824:2529)\n at WindowCdpTransport.window.cdp.onmessage (\u003Canonymous>:918:4707)\n at \u003Canonymous>:1:18","type":"error"}
[0-0] 2025-04-17T22:51:47.463Z INFO webdriver: BIDI RESULT {"id":16,"result":{"contexts":[{"children":[{"children":[],"clientWindow":"","context":"6A0DDA5581AF32EEC634CECF5584E862","originalOpener":null,"url":"https://cdn.affinipay.com/hostedfields/1.5.3/field_1.5.3.html","userContext":"default"},{"children":[],"clientWindow":"","context":"F11C1A5C00C71606F20236D79C585A55","originalOpener":null,"url":"https://cdn.affinipay.com/hostedfields/1.5.3/field_1.5.3.html","userContext":"default"},{"children":[],"clientWindow":"","context":"DD1349587F9AC83D5CD944CE34E9EF0C","originalOpener":null,"url":"","userContext":"default"},{"children":[],"clientWindow":"","context":"A7DE75CF74627A86CE7295502398F87F","originalOpener":null,"url":"about:blank","userContext":"default"}],"clientWindow":"","context":"B077E668828B4B14255DEE615E443C47","originalOpener":null,"parent":null,"url":"https://secure.lawpay.com/pages/wysekadishllp/operating","userContext":"default"}]},"type":"success"}
[0-0] 2025-04-17T22:51:47.463Z INFO webdriver: BIDI RESULT {"id":18,"result":{"contexts":[{"children":[{"children":[],"clientWindow":"","context":"6A0DDA5581AF32EEC634CECF5584E862","originalOpener":null,"url":"https://cdn.affinipay.com/hostedfields/1.5.3/field_1.5.3.html","userContext":"default"},{"children":[],"clientWindow":"","context":"F11C1A5C00C71606F20236D79C585A55","originalOpener":null,"url":"https://cdn.affinipay.com/hostedfields/1.5.3/field_1.5.3.html","userContext":"default"},{"children":[],"clientWindow":"","context":"DD1349587F9AC83D5CD944CE34E9EF0C","originalOpener":null,"url":"","userContext":"default"},{"children":[],"clientWindow":"","context":"A7DE75CF74627A86CE7295502398F87F","originalOpener":null,"url":"about:blank","userContext":"default"}],"clientWindow":"","context":"B077E668828B4B14255DEE615E443C47","originalOpener":null,"parent":null,"url":"https://secure.lawpay.com/pages/wysekadishllp/operating","userContext":"default"}]},"type":"success"}
[0-0] 2025-04-17T22:51:47.464Z INFO webdriver: BIDI RESULT {"id":17,"result":{"realm":"9041442903352442246.-22630127371303264","result":{"type":"undefined"},"type":"success"},"type":"success"}
[0-0] 2025-04-17T22:51:47.621Z INFO webdriver: BIDI RESULT {"error":"unknown error","id":15,"message":"Cannot find context with specified id","stacktrace":"Error\n at new UnknownErrorException (\u003Canonymous>:65:4860)\n at CommandProcessor.processCommand (\u003Canonymous>:453:9934)","type":"error"}
[0-0] 2025-04-17T22:51:48.188Z INFO webdriverio:PolyfillManager: Adding polyfill script to context with id 812D82ECD5888B723B163D2692FE0BC3
[0-0] 2025-04-17T22:51:48.188Z INFO webdriver: BIDI COMMAND script.callFunction {"functionDeclaration":"<Function[442 bytes] webdriverioPolyfill>","target":{"children":null,"clientWindow":"","context":"812D82ECD5888B723B163D2692FE0BC3","originalOpener":null,"parent":"B077E668828B4B14255DEE615E443C47","url":"about:blank","userContext":"default"},"awaitPromise":false}
[0-0] 2025-04-17T22:51:48.190Z INFO webdriver: BIDI RESULT {"id":19,"result":{"realm":"-7067924566077895360.-1517136596642863811","result":{"type":"undefined"},"type":"success"},"type":"success"}
[0-0] 2025-04-17T22:51:48.309Z INFO webdriverio:PolyfillManager: Adding polyfill script to context with id 9475B8C11AD98CE42056A8CB358BE8E2
[0-0] 2025-04-17T22:51:48.309Z INFO webdriver: BIDI COMMAND script.callFunction {"functionDeclaration":"<Function[442 bytes] webdriverioPolyfill>","target":{"children":null,"clientWindow":"","context":"9475B8C11AD98CE42056A8CB358BE8E2","originalOpener":null,"parent":"A7DE75CF74627A86CE7295502398F87F","url":"about:blank","userContext":"default"},"awaitPromise":false}
[0-0] 2025-04-17T22:51:48.311Z INFO webdriver: BIDI RESULT {"id":20,"result":{"realm":"-3901255678510485382.-4457852365904529582","result":{"type":"undefined"},"type":"success"},"type":"success"}
[0-0] 2025-04-17T22:51:48.345Z INFO webdriver: BIDI RESULT {"id":10,"result":{"navigation":"f7d8fef0-648f-4fbf-8823-21dcd7721c5c","url":"https://secure.lawpay.com/pages/wysekadishllp/operating"},"type":"success"}
[0-0] 2025-04-17T22:51:48.346Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"css","value":".ap-accordion-check"},"context":"B077E668828B4B14255DEE615E443C47"}
[0-0] 2025-04-17T22:51:48.347Z INFO webdriver: BIDI RESULT {"id":21,"result":{"nodes":[{"sharedId":"f.B077E668828B4B14255DEE615E443C47.d.0AEA7827AE0F9880CF77912ED59B5CD7.e.12","type":"node","value":{"attributes":{"class":"ap-accordion-check "},"childNodeCount":0,"localName":"div","namespaceURI":"http://www.w3.org/1999/xhtml","nodeType":1,"shadowRoot":null}}]},"type":"success"}
[0-0] 2025-04-17T22:51:48.350Z INFO webdriver: COMMAND elementClick("f.B077E668828B4B14255DEE615E443C47.d.0AEA7827AE0F9880CF77912ED59B5CD7.e.12")
[0-0] 2025-04-17T22:51:48.350Z INFO webdriver: [POST] http://localhost:56230/session/67b798bf8e7ad1d9156af1f9982e51b9/element/f.B077E668828B4B14255DEE615E443C47.d.0AEA7827AE0F9880CF77912ED59B5CD7.e.12/click
[0-0] 2025-04-17T22:51:48.377Z INFO webdriver: RESULT null
[0-0] 2025-04-17T22:51:50.381Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":"//iframe[contains(@title, \"input field\")]"},"context":"B077E668828B4B14255DEE615E443C47"}
[0-0] 2025-04-17T22:51:50.388Z INFO webdriver: BIDI RESULT {"id":22,"result":{"nodes":[{"sharedId":"f.B077E668828B4B14255DEE615E443C47.d.0AEA7827AE0F9880CF77912ED59B5CD7.e.43","type":"node","value":{"attributes":{"sandbox":"allow-scripts allow-same-origin","src":"https://cdn.affinipay.com/hostedfields/1.5.3/field_1.5.3.html","title":"credit card number input field"},"childNodeCount":0,"localName":"iframe","namespaceURI":"http://www.w3.org/1999/xhtml","nodeType":1,"shadowRoot":null}},{"sharedId":"f.B077E668828B4B14255DEE615E443C47.d.0AEA7827AE0F9880CF77912ED59B5CD7.e.44","type":"node","value":{"attributes":{"sandbox":"allow-scripts allow-same-origin","src":"https://cdn.affinipay.com/hostedfields/1.5.3/field_1.5.3.html","title":"cvv input field"},"childNodeCount":0,"localName":"iframe","namespaceURI":"http://www.w3.org/1999/xhtml","nodeType":1,"shadowRoot":null}}]},"type":"success"}
[0-0] 2025-04-17T22:51:50.392Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":"//iframe[contains(@title, \"input field\")]"},"context":"B077E668828B4B14255DEE615E443C47"}
[0-0] 2025-04-17T22:51:50.395Z INFO webdriver: BIDI RESULT {"id":23,"result":{"nodes":[{"sharedId":"f.B077E668828B4B14255DEE615E443C47.d.0AEA7827AE0F9880CF77912ED59B5CD7.e.43","type":"node","value":{"attributes":{"sandbox":"allow-scripts allow-same-origin","src":"https://cdn.affinipay.com/hostedfields/1.5.3/field_1.5.3.html","title":"credit card number input field"},"childNodeCount":0,"localName":"iframe","namespaceURI":"http://www.w3.org/1999/xhtml","nodeType":1,"shadowRoot":null}},{"sharedId":"f.B077E668828B4B14255DEE615E443C47.d.0AEA7827AE0F9880CF77912ED59B5CD7.e.44","type":"node","value":{"attributes":{"sandbox":"allow-scripts allow-same-origin","src":"https://cdn.affinipay.com/hostedfields/1.5.3/field_1.5.3.html","title":"cvv input field"},"childNodeCount":0,"localName":"iframe","namespaceURI":"http://www.w3.org/1999/xhtml","nodeType":1,"shadowRoot":null}}]},"type":"success"}
[0-0] 2025-04-17T22:51:50.397Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":"//iframe[contains(@title, \"input field\")]"},"context":"B077E668828B4B14255DEE615E443C47"}
[0-0] 2025-04-17T22:51:50.399Z INFO webdriver: BIDI RESULT {"id":24,"result":{"nodes":[{"sharedId":"f.B077E668828B4B14255DEE615E443C47.d.0AEA7827AE0F9880CF77912ED59B5CD7.e.43","type":"node","value":{"attributes":{"sandbox":"allow-scripts allow-same-origin","src":"https://cdn.affinipay.com/hostedfields/1.5.3/field_1.5.3.html","title":"credit card number input field"},"childNodeCount":0,"localName":"iframe","namespaceURI":"http://www.w3.org/1999/xhtml","nodeType":1,"shadowRoot":null}},{"sharedId":"f.B077E668828B4B14255DEE615E443C47.d.0AEA7827AE0F9880CF77912ED59B5CD7.e.44","type":"node","value":{"attributes":{"sandbox":"allow-scripts allow-same-origin","src":"https://cdn.affinipay.com/hostedfields/1.5.3/field_1.5.3.html","title":"cvv input field"},"childNodeCount":0,"localName":"iframe","namespaceURI":"http://www.w3.org/1999/xhtml","nodeType":1,"shadowRoot":null}}]},"type":"success"}
[0-0] 2025-04-17T22:51:50.401Z INFO webdriver: BIDI COMMAND script.callFunction {"functionDeclaration":"<Function[137 bytes] anonymous>","awaitPromise":true,"arguments":[{"sharedId":"f.B077E668828B4B14255DEE615E443C47.d.0AEA7827AE0F9880CF77912ED59B5CD7.e.43"}],"target":{"context":"B077E668828B4B14255DEE615E443C47"}}
[0-0] 2025-04-17T22:51:50.404Z INFO webdriver: BIDI RESULT {"id":25,"result":{"realm":"-5890383619349994784.3200228460498315187","result":{"type":"window","value":{"context":"6A0DDA5581AF32EEC634CECF5584E862"}},"type":"success"},"type":"success"}
[0-0] 2025-04-17T22:51:50.404Z INFO webdriver: COMMAND switchToFrame(<object>)
[0-0] 2025-04-17T22:51:50.404Z INFO webdriver: [POST] http://localhost:56230/session/67b798bf8e7ad1d9156af1f9982e51b9/frame
[0-0] 2025-04-17T22:51:50.404Z INFO webdriver: DATA {
[0-0] id: {
[0-0] 'element-6066-11e4-a52e-4f735466cecf': 'f.B077E668828B4B14255DEE615E443C47.d.0AEA7827AE0F9880CF77912ED59B5CD7.e.43'
[0-0] }
[0-0] }
[0-0] 2025-04-17T22:51:50.415Z INFO webdriver: RESULT null
[0-0] 2025-04-17T22:51:50.416Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"css","value":"input"},"context":"6A0DDA5581AF32EEC634CECF5584E862"}
[0-0] 2025-04-17T22:51:50.417Z INFO webdriver: BIDI RESULT {"id":26,"result":{"nodes":[{"sharedId":"f.6A0DDA5581AF32EEC634CECF5584E862.d.101BB7DFC81FD21973C123439ED2F1E2.e.2","type":"node","value":{"attributes":{"aria-label":"credit card number","autocomplete":"off","required":"","type":"text"},"childNodeCount":0,"localName":"input","namespaceURI":"http://www.w3.org/1999/xhtml","nodeType":1,"shadowRoot":{"sharedId":"f.6A0DDA5581AF32EEC634CECF5584E862.d.101BB7DFC81FD21973C123439ED2F1E2.e.5","type":"node","value":{"childNodeCount":1,"mode":"closed","nodeType":11}}}}]},"type":"success"}
[0-0] 2025-04-17T22:51:50.419Z INFO webdriver: COMMAND elementClear("f.6A0DDA5581AF32EEC634CECF5584E862.d.101BB7DFC81FD21973C123439ED2F1E2.e.2")
[0-0] 2025-04-17T22:51:50.419Z INFO webdriver: [POST] http://localhost:56230/session/67b798bf8e7ad1d9156af1f9982e51b9/element/f.6A0DDA5581AF32EEC634CECF5584E862.d.101BB7DFC81FD21973C123439ED2F1E2.e.2/clear
[0-0] 2025-04-17T22:51:50.435Z INFO webdriver: RESULT null
[0-0] 2025-04-17T22:51:50.435Z INFO webdriver: COMMAND elementSendKeys("f.6A0DDA5581AF32EEC634CECF5584E862.d.101BB7DFC81FD21973C123439ED2F1E2.e.2", "123")
[0-0] 2025-04-17T22:51:50.435Z INFO webdriver: [POST] http://localhost:56230/session/67b798bf8e7ad1d9156af1f9982e51b9/element/f.6A0DDA5581AF32EEC634CECF5584E862.d.101BB7DFC81FD21973C123439ED2F1E2.e.2/value
[0-0] 2025-04-17T22:51:50.435Z INFO webdriver: DATA { text: '123' }
[0-0] 2025-04-17T22:51:50.505Z INFO webdriver: RESULT null
[0-0] 2025-04-17T22:51:52.509Z INFO webdriver: COMMAND getElementProperty("f.6A0DDA5581AF32EEC634CECF5584E862.d.101BB7DFC81FD21973C123439ED2F1E2.e.2", "value")
[0-0] 2025-04-17T22:51:52.510Z INFO webdriver: [GET] http://localhost:56230/session/67b798bf8e7ad1d9156af1f9982e51b9/element/f.6A0DDA5581AF32EEC634CECF5584E862.d.101BB7DFC81FD21973C123439ED2F1E2.e.2/property/value
[0-0] 2025-04-17T22:51:52.518Z INFO webdriver: RESULT 123
[0-0] 2025-04-17T22:51:52.520Z INFO webdriver: COMMAND getWindowHandle()
[0-0] 2025-04-17T22:51:52.520Z INFO webdriver: [GET] http://localhost:56230/session/67b798bf8e7ad1d9156af1f9982e51b9/window
[0-0] 2025-04-17T22:51:52.522Z INFO webdriver: RESULT B077E668828B4B14255DEE615E443C47
[0-0] 2025-04-17T22:51:52.522Z INFO webdriver: COMMAND switchToFrame(null)
[0-0] 2025-04-17T22:51:52.522Z INFO webdriver: [POST] http://localhost:56230/session/67b798bf8e7ad1d9156af1f9982e51b9/frame
[0-0] 2025-04-17T22:51:52.522Z INFO webdriver: DATA { id: null }
[0-0] 2025-04-17T22:51:52.527Z INFO webdriver: RESULT null
[0-0] 2025-04-17T22:51:52.527Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":"//iframe[contains(@title, \"input field\")]"},"context":"B077E668828B4B14255DEE615E443C47"}
[0-0] 2025-04-17T22:51:52.529Z INFO webdriver: BIDI RESULT {"id":27,"result":{"nodes":[{"sharedId":"f.B077E668828B4B14255DEE615E443C47.d.0AEA7827AE0F9880CF77912ED59B5CD7.e.43","type":"node","value":{"attributes":{"cd_frame_id_":"b2578844cab003127d175b6aef0d8842","sandbox":"allow-scripts allow-same-origin","src":"https://cdn.affinipay.com/hostedfields/1.5.3/field_1.5.3.html","title":"credit card number input field"},"childNodeCount":0,"localName":"iframe","namespaceURI":"http://www.w3.org/1999/xhtml","nodeType":1,"shadowRoot":null}},{"sharedId":"f.B077E668828B4B14255DEE615E443C47.d.0AEA7827AE0F9880CF77912ED59B5CD7.e.44","type":"node","value":{"attributes":{"sandbox":"allow-scripts allow-same-origin","src":"https://cdn.affinipay.com/hostedfields/1.5.3/field_1.5.3.html","title":"cvv input field"},"childNodeCount":0,"localName":"iframe","namespaceURI":"http://www.w3.org/1999/xhtml","nodeType":1,"shadowRoot":null}}]},"type":"success"}
[0-0] 2025-04-17T22:51:52.531Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":"//iframe[contains(@title, \"input field\")]"},"context":"B077E668828B4B14255DEE615E443C47"}
[0-0] 2025-04-17T22:51:52.533Z INFO webdriver: BIDI RESULT {"id":28,"result":{"nodes":[{"sharedId":"f.B077E668828B4B14255DEE615E443C47.d.0AEA7827AE0F9880CF77912ED59B5CD7.e.43","type":"node","value":{"attributes":{"cd_frame_id_":"b2578844cab003127d175b6aef0d8842","sandbox":"allow-scripts allow-same-origin","src":"https://cdn.affinipay.com/hostedfields/1.5.3/field_1.5.3.html","title":"credit card number input field"},"childNodeCount":0,"localName":"iframe","namespaceURI":"http://www.w3.org/1999/xhtml","nodeType":1,"shadowRoot":null}},{"sharedId":"f.B077E668828B4B14255DEE615E443C47.d.0AEA7827AE0F9880CF77912ED59B5CD7.e.44","type":"node","value":{"attributes":{"sandbox":"allow-scripts allow-same-origin","src":"https://cdn.affinipay.com/hostedfields/1.5.3/field_1.5.3.html","title":"cvv input field"},"childNodeCount":0,"localName":"iframe","namespaceURI":"http://www.w3.org/1999/xhtml","nodeType":1,"shadowRoot":null}}]},"type":"success"}
[0-0] 2025-04-17T22:51:52.535Z INFO webdriver: BIDI COMMAND script.callFunction {"functionDeclaration":"<Function[137 bytes] anonymous>","awaitPromise":true,"arguments":[{"sharedId":"f.B077E668828B4B14255DEE615E443C47.d.0AEA7827AE0F9880CF77912ED59B5CD7.e.43"}],"target":{"context":"B077E668828B4B14255DEE615E443C47"}}
[0-0] 2025-04-17T22:51:52.536Z INFO webdriver: BIDI RESULT {"id":29,"result":{"realm":"-5890383619349994784.3200228460498315187","result":{"type":"window","value":{"context":"6A0DDA5581AF32EEC634CECF5584E862"}},"type":"success"},"type":"success"}
[0-0] 2025-04-17T22:51:52.537Z INFO webdriver: COMMAND switchToFrame(<object>)
[0-0] 2025-04-17T22:51:52.537Z INFO webdriver: [POST] http://localhost:56230/session/67b798bf8e7ad1d9156af1f9982e51b9/frame
[0-0] 2025-04-17T22:51:52.537Z INFO webdriver: DATA {
[0-0] id: {
[0-0] 'element-6066-11e4-a52e-4f735466cecf': 'f.B077E668828B4B14255DEE615E443C47.d.0AEA7827AE0F9880CF77912ED59B5CD7.e.43'
[0-0] }
[0-0] }
[0-0] 2025-04-17T22:51:52.546Z INFO webdriver: RESULT null
[0-0] 2025-04-17T22:51:52.546Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"css","value":"input"},"context":"6A0DDA5581AF32EEC634CECF5584E862"}
[0-0] 2025-04-17T22:51:52.547Z INFO webdriver: BIDI RESULT {"id":30,"result":{"nodes":[{"sharedId":"f.6A0DDA5581AF32EEC634CECF5584E862.d.101BB7DFC81FD21973C123439ED2F1E2.e.2","type":"node","value":{"attributes":{"aria-label":"credit card number","autocomplete":"off","required":"","type":"text"},"childNodeCount":0,"localName":"input","namespaceURI":"http://www.w3.org/1999/xhtml","nodeType":1,"shadowRoot":{"sharedId":"f.6A0DDA5581AF32EEC634CECF5584E862.d.101BB7DFC81FD21973C123439ED2F1E2.e.5","type":"node","value":{"childNodeCount":1,"mode":"closed","nodeType":11}}}}]},"type":"success"}
[0-0] 2025-04-17T22:51:52.548Z INFO webdriver: COMMAND elementClear("f.6A0DDA5581AF32EEC634CECF5584E862.d.101BB7DFC81FD21973C123439ED2F1E2.e.2")
[0-0] 2025-04-17T22:51:52.548Z INFO webdriver: [POST] http://localhost:56230/session/67b798bf8e7ad1d9156af1f9982e51b9/element/f.6A0DDA5581AF32EEC634CECF5584E862.d.101BB7DFC81FD21973C123439ED2F1E2.e.2/clear
[0-0] 2025-04-17T22:51:52.561Z INFO webdriver: RESULT null
[0-0] 2025-04-17T22:51:52.561Z INFO webdriver: COMMAND elementSendKeys("f.6A0DDA5581AF32EEC634CECF5584E862.d.101BB7DFC81FD21973C123439ED2F1E2.e.2", "456")
[0-0] 2025-04-17T22:51:52.561Z INFO webdriver: [POST] http://localhost:56230/session/67b798bf8e7ad1d9156af1f9982e51b9/element/f.6A0DDA5581AF32EEC634CECF5584E862.d.101BB7DFC81FD21973C123439ED2F1E2.e.2/value
[0-0] 2025-04-17T22:51:52.561Z INFO webdriver: DATA { text: '456' }
[0-0] 2025-04-17T22:51:52.579Z INFO webdriver: RESULT null
[0-0] 2025-04-17T22:51:54.580Z INFO webdriver: COMMAND getElementProperty("f.6A0DDA5581AF32EEC634CECF5584E862.d.101BB7DFC81FD21973C123439ED2F1E2.e.2", "value")
[0-0] 2025-04-17T22:51:54.580Z INFO webdriver: [GET] http://localhost:56230/session/67b798bf8e7ad1d9156af1f9982e51b9/element/f.6A0DDA5581AF32EEC634CECF5584E862.d.101BB7DFC81FD21973C123439ED2F1E2.e.2/property/value
[0-0] 2025-04-17T22:51:54.583Z INFO webdriver: RESULT 456
[0-0] Error in "Multiple frames with same src.should switch the the correct frame and properly set input values"
Error: Second Frame element was changed
at Context.<anonymous> (file:///Users/*****/Documents/projects/wdio-test/test/specs/test.e2e.js:42:10)
[0-0] 2025-04-17T22:51:54.584Z INFO webdriver: COMMAND deleteSession()
[0-0] 2025-04-17T22:51:54.584Z INFO webdriver: [DELETE] http://localhost:56230/session/67b798bf8e7ad1d9156af1f9982e51b9
[0-0] 2025-04-17T22:51:54.636Z INFO webdriver: RESULT null
[0-0] 2025-04-17T22:51:54.636Z INFO webdriver: Close Bidi connection to ws://127.0.0.1:56230/session/67b798bf8e7ad1d9156af1f9982e51b9
[0-0] 2025-04-17T22:51:54.637Z INFO webdriver: Kill driver process with PID 64808
[0-0] FAILED in chrome - file:///test/specs/test.e2e.js
2025-04-17T22:51:54.750Z INFO @wdio/cli:launcher: Run onWorkerEnd hook
"spec" Reporter:
------------------------------------------------------------------
[chrome 135.0.7049.96 mac #0-0] Running: chrome (v135.0.7049.96) on mac
[chrome 135.0.7049.96 mac #0-0] Session ID: 67b798bf8e7ad1d9156af1f9982e51b9
[chrome 135.0.7049.96 mac #0-0]
[chrome 135.0.7049.96 mac #0-0] » /test/specs/test.e2e.js
[chrome 135.0.7049.96 mac #0-0] Multiple frames with same src
[chrome 135.0.7049.96 mac #0-0] ✖ should switch the the correct frame and properly set input values
[chrome 135.0.7049.96 mac #0-0]
[chrome 135.0.7049.96 mac #0-0] 1 failing (8.5s)
[chrome 135.0.7049.96 mac #0-0]
[chrome 135.0.7049.96 mac #0-0] 1) Multiple frames with same src should switch the the correct frame and properly set input values
[chrome 135.0.7049.96 mac #0-0] Second Frame element was changed
[chrome 135.0.7049.96 mac #0-0] Error: Second Frame element was changed
[chrome 135.0.7049.96 mac #0-0] at Context.<anonymous> (file:///Users/******/Documents/projects/wdio-test/test/specs/test.e2e.js:42:10)
Spec Files: 0 passed, 1 failed, 1 total (100% completed) in 00:00:11
2025-04-17T22:51:54.751Z INFO @wdio/local-runner: Shutting down spawned worker
2025-04-17T22:51:55.003Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2025-04-17T22:51:55.004Z INFO @wdio/local-runner: shutting down
2025-04-17T22:51:55.004Z INFO @wdio/cli:launcher: Run onComplete hookCode of Conduct
- I agree to follow this project's Code of Conduct
Is there an existing issue for this?
- I have searched the existing issues
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Bug 🐛help wantedIssues that are free to take by anyone interestedIssues that are free to take by anyone interested