question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[🐛 Bug]: Unable to switch back to default window

See original GitHub issue

What happened?

I upgraded to selenium 4.1.0 binding. When executing a test case which has steps: To Switch to iframe Enter some value Switch back to defaultWindow Click a button

Passes on local machine but when executing on selenium grid 4.1.0, it fails with error “Error communicating with the remote browser. It may have died.”

Test case fails at “Switch back to defaultWindow” step.

How can we reproduce the issue?

Go to site with Iframe
Switch to iframe 
Enter some value (e.g. work in iframe)
Switch back to defaultWindow (This is the step test case fails)
Click a button

Relevant log output

org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: '4.1.0', revision: '87802e897b'
System info: host: 'MMODI-CHI', ip: '192.168.1.62', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.16', java.version: '11.0.5'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Command: [05340cc11c0d83ffe3bd398767a23dc4af5601a0, switchToFrame {id=null}]
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 96.0.4664.45, chrome: {chromedriverVersion: 96.0.4664.35 (8df3babf8da8f..., userDataDir: /var/folders/yj/h3bj394n2tn...}, goog:chromeOptions: {debuggerAddress: localhost:53048}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: MAC, platformName: MAC, proxy: Proxy(), se:cdpVersion: 96.0.4664.45, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:virtualAuthenticators: true}
Session ID: 05340cc11c0d83ffe3bd398767a23dc4af5601a0
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:583)
	at org.openqa.selenium.remote.RemoteWebDriver$RemoteTargetLocator.defaultContent(RemoteWebDriver.java:1042)

Operating System

Mac BigSur

Selenium version

4.1.0

What are the browser(s) and version(s) where you see this issue?

Chrome 96

What are the browser driver(s) and version(s) where you see this issue?

ChromeDriver 96.0.4664.45

Are you using Selenium Grid?

4.1.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
diemolcommented, Dec 14, 2021

This is a duplicate of #10116, we have already a fix that will be released in either on 15.12 or 16.12.

1reaction
MihirModiACcommented, Dec 14, 2021

The defect is in Selenium Grid 4.1.0 not local execution.

I mentioned that local execution works but Selenium Grid has problem.

Also I am using the “switchToDefault” command not “switchToParent”.

Thank you

Mihir Modi ActiveCampaign / Staff Software Engineer @.*** 1 North Dearborn St, 5th Floor, Chicago IL, 60602, USA https://www.facebook.com/activecampaign http://www.twitter.com/activecampaign https://www.linkedin.com/company/activecampaign-inc- https://www.instagram.com/activecampaign/

https://www.activecampaign.com/sig/?u=mmodi&c=1

On Mon, Dec 13, 2021 at 8:08 PM praveendvd @.***> wrote:

describe(‘My Login application’, () => { it(‘should login with valid credentials’, async () => {

    await browser.url('https://selectorshub.com/xpath-practice-page/');
    await expect( $('h3=Food Time')).toBeExisting();
    await browser.switchToFrame(await $('#pact'))
    await expect( $('h3=Food Time')).not.toBeExisting();
    await expect( $('#jest')).toBeExisting();
    await browser.switchToParentFrame();
    await expect($('#jest')).not.toBeExisting();
});

});

It works as expected

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/SeleniumHQ/selenium/issues/10142*issuecomment-993087849__;Iw!!JIZ-LZtDGnv5HBqN_A!aGnrs6jzlhw22hS7_Z_PpB6kcqfRwuHN1pJf6rEJxMMHG8Hwc2VlFP-EbN69qlMjQcM$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AN3E7KAAIJ5B2X2IMU53QY3UQ2RKVANCNFSM5J7ARVTA__;!!JIZ-LZtDGnv5HBqN_A!aGnrs6jzlhw22hS7_Z_PpB6kcqfRwuHN1pJf6rEJxMMHG8Hwc2VlFP-EbN69LYLzARE$ . Triage notifications on the go with GitHub Mobile for iOS https://urldefense.com/v3/__https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675__;!!JIZ-LZtDGnv5HBqN_A!aGnrs6jzlhw22hS7_Z_PpB6kcqfRwuHN1pJf6rEJxMMHG8Hwc2VlFP-EbN69cNTwELk$ or Android https://urldefense.com/v3/__https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign*3Dnotification-email*26utm_medium*3Demail*26utm_source*3Dgithub__;JSUlJSU!!JIZ-LZtDGnv5HBqN_A!aGnrs6jzlhw22hS7_Z_PpB6kcqfRwuHN1pJf6rEJxMMHG8Hwc2VlFP-EbN699so2uNE$.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows 10 bug - switching windows does not work
Hello, after some time (hours), I'm unable to switch windows using taskbar, alt+tab or even win+tab. Also, clicking into another window does not...
Read more >
How To Fix Can't Change Default Program In Windows Issue
Fix #7: Reset to default. · Open Settings menu by pressing the Windows key + I. · Go to Apps. · Click on...
Read more >
How to switch to the new browser window, which opens after ...
To go back to the main window(default window) . use driver.switchTo(). ... Source: Selenium WebDriver windows switching issue in Internet Explorer 8-10.
Read more >
Top 9 Ways to Fix Unable to Change Default Programs in ...
Open Settings on your computer or use the Windows key + I keyboard shortcut to open Settings. Go to Apps. Click on Default...
Read more >
SOLVED: Can't change Windows 10 default apps
This whole issue seems to be caused by Windows Update. The Anniversary Update had a similar bug and it was (kind of) sorted...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found