Issue 5397 in selenium: Cookie Validate() function incorrectly throwing InvalidOperationException

23 views
Skip to first unread message

sele...@googlecode.com

unread,
Mar 25, 2013, 4:41:42 PM3/25/13
to selenium-develope...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium Status-Untriaged

New issue 5397 by dan...@cubetek.net: Cookie Validate() function
incorrectly throwing InvalidOperationException
http://code.google.com/p/selenium/issues/detail?id=5397

When a server sends a set-cookie header with a blank value, firefox saves
the cookie as an empty string. The validate() function throws an exception
when this occurs.

One of my tests logs all cookies after taking a screenshot:
322: x.add("Cookies: "+driver.manage().getCookies().toString());

In cases where there are blank cookie values, this exception occurs:
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at
org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: org.openqa.selenium.WebDriverException: Required attributes are
not set or any non-null attribute set to null
Command duration or timeout: 40 milliseconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: os.name: 'Linux', os.arch: 'amd64',
os.version: '2.6.32-5-amd64', java.version: '1.6.0_18'
Session ID: 094baa69-6804-4131-9f56-f2365abd33bb
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{platform=XP, javascriptEnabled=true, acceptSslCerts=true,
browserName=firefox, rotatable=false, locationContextEnabled=true,
webdriver.remote.sessionid=094baa69-6804-4131-9f56-f2365abd33bb,
version=19.0.2, databaseEnabled=true, cssSelectorsEnabled=true,
handlesAlerts=true, browserConnectionEnabled=true, webStorageEnabled=true,
nativeEvents=true, applicationCacheEnabled=true, takesScreenshot=true}]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at
org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:187)
at
org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:533)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)
at
org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions.getCookies(RemoteWebDriver.java:616)
at com.chitika.selenium.tests.Test.takeScreenshots(Test.java:322)
at
com.chitika.selenium.tests.GenericWebsiteScreenshot.test(GenericWebsiteScreenshot.java:27)
at com.chitika.selenium.TestWrapper.main(TestWrapper.java:71)
... 5 more
Caused by: java.lang.IllegalArgumentException: Required attributes are not
set or any non-null attribute set to null
at org.openqa.selenium.Cookie.validate(Cookie.java:140)
at org.openqa.selenium.Cookie.<init>(Cookie.java:86)
at org.openqa.selenium.Cookie$Builder.build(Cookie.java:225)
at
org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions.getCookies(RemoteWebDriver.java:665)
at
org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringOptions.getCookies(EventFiringWebDriver.java:518)
at
org.openqa.selenium.remote.server.handler.GetAllCookies.call(GetAllCookies.java:33)
at
org.openqa.selenium.remote.server.handler.GetAllCookies.call(GetAllCookies.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at
org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:169)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
Source)
at java.lang.Thread.run(Unknown Source)


Selenium version: 2.31.0
OS: Any
Browser: Firefox
Browser version: 19 (latest)


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

sele...@googlecode.com

unread,
Mar 29, 2013, 4:07:23 PM3/29/13
to selenium-develope...@googlegroups.com
Updates:
Labels: Lang-Java

Comment #1 on issue 5397 by barancev: Cookie Validate() function
incorrectly throwing InvalidOperationException
http://code.google.com/p/selenium/issues/detail?id=5397

(No comment was entered for this change.)

sele...@googlecode.com

unread,
Jan 15, 2014, 5:47:21 AM1/15/14
to selenium-develope...@googlegroups.com
Updates:
Status: Fixed

Comment #2 on issue 5397 by barancev: Cookie Validate() function
incorrectly throwing InvalidOperationException
http://code.google.com/p/selenium/issues/detail?id=5397

This issue was closed by revision 546209825f8d.

sele...@googlecode.com

unread,
Jan 30, 2014, 3:05:43 AM1/30/14
to selenium-develope...@googlegroups.com

Comment #3 on issue 5397 by barancev: Cookie Validate() function
incorrectly throwing InvalidOperationException
http://code.google.com/p/selenium/issues/detail?id=5397

Issue 5790 has been merged into this issue.
Reply all
Reply to author
Forward
0 new messages