WebDriverException: unknown error: Runtime.executionContextCreated has invalid 'context': while initializing Chrome browser
Solution 1:
This error message...
org.openqa.selenium.WebDriverException: unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"11895A1B77AC560388AA2919259E1422","isDefault":true},"id":1,"name":"","origin":"://"}
...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser i.e. Chrome Browser session.
Your main issue is the version compatibility between the binaries you are using as follows :
- You are using chromedriver=2.8 which is pretty ancient.
- You are using chrome=66.0
- Release Notes of ChromeDriver v2.38 clearly mentions the following :
Supports Chrome v65-67
So there is a clear mismatch between ChromeDriver version (v2.8) and the Chrome Browser version (v66.0)
Solution
- Upgrade ChromeDriver to current ChromeDriver v2.38 level.
- Keep Chrome version at Chrome v66.x levels. (as per ChromeDriver v2.38 release notes)
- Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
- Use CCleaner tool to wipe off all the OS chores before and after the execution of your test Suite.
- If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
- Take a System Reboot.
- Execute your
@Test
. - Always invoke
driver.quit()
withintearDown(){}
method to close & destroy the WebDriver and Web Client instances gracefully.