Reputation: 31
When my script is trying to sendkeys for username after opening login page, I am getting disconnected: received Inspector.detached event error.
Console details:
SaveReport FAILED: SaveSearche org.openqa.selenium.WebDriverException: disconnected: received Inspector.detached event (Session info: chrome=49.0.2623.110) (Driver info: chromedriver=2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067),platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 334 milliseconds Build info: version: '2.42.2', revision: '6a6995d', time: '2014-06-03 17:42:03' System info: host: 'jp-anal-l01', ip: '182.178.5.177', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_79' Session ID: b963137ae8a484c47efd3ac0984ea6b3 Driver info: org.openqa.selenium.chrome.ChromeDriver Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={userDataDir=C:\Users\ANJH1.NA\Temp\dir10584}, rotatable=false, locationContextEnabled=true, mobileEmulationEnabled=false, version=49.0.2623.110, takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, nativeEvents=true, webStorageEnabled=true, hasTouchScreen=false, applicationCacheEnabled=false, takesScreenshot=true}] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599) at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:268) at org.openqa.selenium.remote.RemoteWebElement.sendKeys(RemoteWebElement.java:89) at com.demoProject.loginAllTime(TestSuiteTestCases.java:99) at com.demoProject.TestCases.SaveSearch(TestSuiteTestCases.java:317) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at [snip] at org.testng.TestRunner.privateRun(TestRunner.java:767) at org.testng.TestRunner.run(TestRunner.java:617) [snip] org.testng.TestNG.run(TestNG.java:1057) at com.demoProject.executeTestCase(TestSuiteTestCases.java:99) at com.demoProject.initialize(TestSuiteTestCases.java:56) at com.demoProject.executeModules(TestSuiteTestCases.java:142) at com.demoProject.main(TestSuiteTestCases.java:98)
Upvotes: 3
Views: 10554
Reputation: 5781
This is about chrome issue(https://bugs.chromium.org/p/chromedriver/issues/detail?id=1194).
When you are running selenium program, you cannot press F12
to open dev tools manually, or it'll throw this exception sometimes.
According to the issue list, it looks like fixed, but I still meet this bug in ChromeDriver 2.29
Upvotes: 1
Reputation: 5113
Without having the actual test code, my best guess is that com.demoProject.loginAllTime()
, which is calling sendKeys()
, must be sending either Ctrl-Shift-I, or Ctrl-Shift-J, or Ctrl-Shift-C, each of which will open the Chrome DevTools on Windows.
As mentioned in the comments, if DevTools is opened during a WebDriver run, ChromeDriver will be automatically disconnected, producing the error:
received Inspector.detached event
It doesn't seem to be possible to get that error any other way.
Upvotes: 3