Selenium error when deleting cookies - selenium

Has anyone encountered this issue when Selenium tries to delete cookies?
After months of working fine and not changing anything, we're suddenly hitting this error when running tests:
System.InvalidOperationException : unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"(FE3E5C7422F34F92AF238C0A8EBA89BF)","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=64.0.3282.167)
(Driver info: chromedriver=2.9.248315,platform=Windows NT 6.3 x86_64)
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteCookieJar.DeleteAllCookies()
at FluentAutomation.CommandProvider.<>c__DisplayClass2.<.ctor>b__0()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at FluentAutomation.CommandProvider.get_webDriver()
at FluentAutomation.CommandProvider.<>c__DisplayClassc.<FindMultiple>b__a()
at FluentAutomation.ElementProxy.get_Elements()

The error says it all :
System.InvalidOperationException : unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"(FE3E5C7422F34F92AF238C0A8EBA89BF)","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=64.0.3282.167)
(Driver info: chromedriver=2.9.248315,platform=Windows NT 6.3 x86_64)
Your main issue is the compatibility between the Version of the Binaries you are using.
You are using chromedriver=2.9
Release Notes of chromedriver=2.9 clearly mentions the following :
Supports Chrome v31-34
You are using Chrome Browser version 64.0
So there is a clear mismatch between the Version of the Binaries.
Solution
Upgrade your ChromeDriver to recent ChromeDriver=2.35 level.
As per the Release Notes of ChromeDriver=2.35 upgrade your Chrome Browser to Chrome v62-64 levels.
If your base Chrome Browser version is too old uninstall Chrome Browser through Revo Uninstaller and install a recent released GA version of Chrome Browser
Execute your Tests

Related

Using correct ChromeDriver.exe but still getting driver version error message

so the issue I'm having is when I try to run my automation tests with the Chrome Web browser, I get the following error message:
System.InvalidOperationException
HResult=0x80131509
Message=session not created: This version of ChromeDriver only supports Chrome version 80
(Driver info: chromedriver=80.0.3987.106 (f68069574609230cf9b635cd784cfb1bf81bb53a-refs/branch-heads/3987#{#882}),platform=Windows NT 10.0.17763 x86_64) (InsecureCertificate)
Source=WebDriver
StackTrace:
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)
at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options)
at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service)
at Gov.Baaqmd.Tests.SeleniumUITests.SeleniumUITests.InitializeWebDriver() in D:\NPS\Tests ProductionSystem WebUI\SeleniumUITests\Framework\SeleniumUITests.cs:line 250
at Gov.Baaqmd.Tests.SeleniumUITests.SeleniumUITests.TestInitialize() in D:\NPS\Tests ProductionSystem WebUI\SeleniumUITests\Framework\SeleniumUITests.cs:line 168
After the first time I got this error message, I went to Chromium.org page and looked through their directory for the correct chromedriver version that was specified in the error message above, downloaded it and replaced it with the existing chrome driver I had. Once that was done, I tried running my automation script again, but got the same exact error message and I'm at a loss as to what to do next.
My Selenium.Support nuget package = v3.9.1
My Selenium.WebDriver nuget package = V3.9.1
My current version of my Google Chrome web
browser = Version 83.0.4103.106 (Official Build) (64-bit)
I do find it weird that the chromedrivers from the website are Win32 bit versions, I don't know if that's part of the issue.
The chrome version should match with your chromedriver.exe, if you want to update along with the chrome browser version use WebDriverManager
This will update your chromedriver everytime you run the tests. Else download it manually , but the versions needs to be compatible and workable.
Figure out how does your test framework obtains chromedriver. Cases I had dealt with:
Framework runs the chromedriver that is installed on the machine in advance - if you're on Windows, go check PATH env variable to make sure that there's no path to some old driver you've forgotten about
Framework downloads the chromedriver according to the version that is set in the configs - you just need to adjust the configs and set compatible version
https://chromedriver.chromium.org
Check above link , you should use right chrome driver exe file according to your chrome browser version
The Selenium error messaging is poor, and remains so (2 years after this question was posted). When they say "This version of ChromeDriver only supports Chrome version X", they mean the major versions must match exactly. Chrome cannot be newer than ChromeDiver, and ChromeDriver cannot be newer than Chrome. You can solve by upgrading one or downgrading the other.
Check if the chrome driver is in C: drive or in some other drive location, I got the same issue. But when i stored the chromedriver in C drive and given location from there it's working.

HOOK-ERROR in after_step: TimeoutException: Message: timeout

Sometimes, when my script is run by jenkins i get an error:
HOOK-ERROR in after_step: TimeoutException: Message: timeout
(Session info: chrome=69.0.3497.92)
(Driver info: chromedriver=2.35.528139
(47ead77cb35ad2a9a83248b292151462a66cd881),platform=Linux 4.4.0-128-generic x86_64)
i cannot reproduce this situation on my local machine. Do you have any idea how can i check and fix it?
This error message...
HOOK-ERROR in after_step: TimeoutException: Message: timeout
(Session info: chrome=69.0.3497.92)
(Driver info: chromedriver=2.35.528139
...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser i.e. Chrome Browser session.
Your main issue is the incompatibility between the version of the binaries you are using as follows:
You are using chromedriver=2.35
Release Notes of chromedriver=2.35 clearly mentions the following :
Supports Chrome v62-64
You are using chrome=69.0
Release Notes of ChromeDriver v2.43 clearly mentions the following :
Supports Chrome v69-71
So there is a clear mismatch between the ChromeDriver v2.35 and the Chrome Browser v69.0
Solution
Upgrade JDK to recent levels JDK 8u191.
Upgrade Selenium to current levels Version 3.14.0.
Upgrade ChromeDriver to current ChromeDriver v2.42 level.
Keep Chrome version between Chrome v69-71 levels. (as per ChromeDriver v2.43 release notes)
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
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.
Execute your #Test.

Error number: 33: SessionNotCreatedError session not created exception from unknown error while trying to simulate chrome browser using SeleniumBasic

I have been using the COM interface provided by Internet Explorer but, since some sites have now moved on and don't support IE, I have been looking to substitute this with SeleniumBasic.
As this is completely new to me, I'm at the very basic level - I've downloaded the
Selenium Type Library (I've downloaded the Selenium library reference from Github, and referenced is in the module).
I've put in a very basic bit of code to test it out but I'm getting the following error:
Error number: 33
Error description:
SessionNotCreatedError session not created exception from unknown
error: Runtime.executionContextCreated has invalid 'context':
{"auxData":{"frameId":"AE85B634088DDFB4B8E7D65A145ADA0F","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=69.0.3497.100) (Driver info:
chromedriver=2.21.371459
(36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Windows NT 10.0
x86_64)
The code is;
Sub TestCode()
Dim driver as New Selenium.Chrome
driver.get "www.Google.com"
End Sub
I've tried this with firefox and Edge browsers too but am getting the same issues - any suggestions on what might be going wrong?
This error message...
SessionNotCreatedError session not created exception from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"AE85B634088DDFB4B8E7D65A145ADA0F","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=69.0.3497.100)
(Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Windows NT 10.0 x86_64)
...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser i.e. Chrome Browser session.
Your main issue is the incompatibility between the version of the binaries you are using as follows:
You are using chromedriver=2.21
Release Notes of chromedriver=2.21 clearly mentions the following :
Supports Chrome v46-50
You are using chrome=69.0
Release Notes of ChromeDriver v2.42 clearly mentions the following :
Supports Chrome v68-70
So there is a clear mismatch between ChromeDriver v2.21 and the Chrome Browser v69.0
Solution
Upgrade Selenium to current levels Version 3.14.0.
Upgrade ChromeDriver to current ChromeDriver v2.42 level.
Keep Chrome version between Chrome v68-70 levels. (as per ChromeDriver v2.42 release notes)
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
Execute your #Test.
Update A
As per florentbr/SeleniumBasic the last version of SeleniumBasic (A Selenium based browser automation framework for VB.Net, Visual Basic Applications and VBScript) seems to be Release v2.0.9.0 only.
As per the CHANGELOG of Release v2.0.9.0 the underlying components are:
Firefox driver version 2.52.0
IE driver version 2.52.1
Update B
If you intend to use GeckoDriver with Firefox you can following the matrix below:

Unable to scroll chrome browser using Appium

I am trying to scrolldown chrome browser for my appium project but I am unable to scroll down. Below is the error message.
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value'
(Session info: chrome=65.0.3325.109)
(Driver info: chromedriver=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform=Windows NT 10.0.16299 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
There is a mismatch between ChromDriver and ChromeBroser version may be. How to check my ChromeDriver verison (2.33 as present in the error log) in my android device. How can I update the current version?
Update both chrome browser and chrome driver to latest version.Recent version of chrome browser doesn't work until driver is updated to latest version.
I found a solution how to fix the issue with updating the chrome driver to 2.36 It was to download the chromedriver version and replace it with the "chromedriver" that is taken by Appium the path was
C:\Users\Hamza_Soltani\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win\chromedriver.exe

Selenium ChromeDriver in TeamCity 9.1.7 - Cannot find Chrome binary

I am running specflow in VS with chromedriver 2.22.0.0 (installed via nuget package). Locally, chromedriver launches and all tests run fine.
However, when trying to run in TeamCity 9, I get the following error:
Test(s) failed. System.InvalidOperationException : unknown error: cannot find Chrome binary
(Driver info: chromedriver=2.22.397933 (1cab651507b88dec79b2b2a22d1943c01833cc1b),platform=Windows NT 6.3.9600 x86_64)
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeOptions options)
I have checked that the package exists on the TeamCity server and it does. In fact, it actually launches chromedriver.exe in the background as I can see it in the Task Manager.
Could it be that the version of chromedriver is not compatible with windows server where TeamCity is running? Any ideas?
Any help appreciated!
Alternatively, what is best when running specflow tests with chromedriver in TeamCity?
I had exactly the same issue, though on TeamCity 2017.1.5. For me it helped to install Chrome (actual full browser) on the same machine. It seems that ChromeDriver is sharing some code with the mothership ?
One would thought that ChromeDriver should be stand alone binary but that seems not be a case...