New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Adding Cookies to Firefox on a Grid #1575

Closed
rebelagentm opened this Issue Feb 1, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@rebelagentm

rebelagentm commented Feb 1, 2016

When trying to run a test that calls driver.manage.add_cookie() on a Grid, the following error is reported back from the Grid:

java.lang.String cannot be cast to java.lang.Boolean (java.lang.ClassCastException) (Selenium::WebDriver::Error::UnknownError)
[remote server] org.openqa.selenium.remote.server.handler.AddCookie(AddCookie.java):65:in createCookie' [remote server] org.openqa.selenium.remote.server.handler.AddCookie(AddCookie.java):84:intoString'
[remote server] java.util.Formatter$FormatSpecifier(Formatter.java):2886:in printString' [remote server] java.util.Formatter$FormatSpecifier(Formatter.java):2763:inprint'
[remote server] java.util.Formatter(Formatter.java):2520:in format' [remote server] java.util.Formatter(Formatter.java):2455:informat'
[remote server] java.lang.String(String.java):2940:in format' [remote server] org.openqa.selenium.remote.server.rest.ResultConfig(ResultConfig.java):108:inhandle'
[remote server] org.openqa.selenium.remote.server.JsonHttpCommandHandler(JsonHttpCommandHandler.java):175:in handleRequest' [remote server] org.openqa.selenium.remote.server.DriverServlet(DriverServlet.java):202:inhandleRequest'
[remote server] org.openqa.selenium.remote.server.DriverServlet(DriverServlet.java):164:in doPost' [remote server] javax.servlet.http.HttpServlet(HttpServlet.java):707:inservice'
[remote server] org.openqa.selenium.remote.server.DriverServlet(DriverServlet.java):130:in service' [remote server] javax.servlet.http.HttpServlet(HttpServlet.java):790:inservice'
[remote server] org.openqa.jetty.jetty.servlet.ServletHolder(ServletHolder.java):428:in handle' [remote server] org.openqa.jetty.jetty.servlet.ServletHandler(ServletHandler.java):680:indispatch'
[remote server] org.openqa.jetty.jetty.servlet.ServletHandler(ServletHandler.java):571:in handle' [remote server] org.openqa.jetty.http.HttpContext(HttpContext.java):1526:inhandle'
[remote server] org.openqa.jetty.http.HttpContext(HttpContext.java):1479:in handle' [remote server] org.openqa.jetty.http.HttpServer(HttpServer.java):920:inservice'
[remote server] org.openqa.jetty.http.HttpConnection(HttpConnection.java):820:in service' [remote server] org.openqa.jetty.http.HttpConnection(HttpConnection.java):986:inhandleNext'
[remote server] org.openqa.jetty.http.HttpConnection(HttpConnection.java):837:in handle' [remote server] org.openqa.jetty.http.SocketListener(SocketListener.java):243:inhandleConnection'
[remote server] org.openqa.jetty.util.ThreadedServer(ThreadedServer.java):358:in handle' [remote server] org.openqa.jetty.util.ThreadPool$PoolThread(ThreadPool.java):537:inrun'

Specifically, my Ruby code is this:

I have a line like this that works fine. identityToken is the name of the cookie and TOKEN is a string being loaded in from a file:
driver.manage.add_cookie(name: 'identityToken', value: TOKEN)

This second line is where it seems to break, where .ASPXAUTH is the name of the cookie, and XAUTH is a string being loaded in from a file:
driver.manage.add_cookie(name: '.ASPXAUTH', value: XAUTH, secure: 'true')

Technical specs:
Grid version: 2.48.2
Ruby Selenium version: I've tried it with 2.48.2, 2.49, and 2.50
Ruby version: 2.3.0
Firefox version: 43.0.4
OS: Ubuntu 12.04.5 Server
Java version: OpenJDK 8

This error does not occur when I run the test locally. It seems to only occur on the Grid.

@barancev

This comment has been minimized.

Show comment
Hide comment
@barancev

barancev Feb 1, 2016

Member

For issues please provide a concise reproducible test case and describe what results you are seeing and what results you expect.

See CONTRIBUTING.md

Member

barancev commented Feb 1, 2016

For issues please provide a concise reproducible test case and describe what results you are seeing and what results you expect.

See CONTRIBUTING.md

@rebelagentm

This comment has been minimized.

Show comment
Hide comment
@rebelagentm

rebelagentm Feb 1, 2016

@barancev I just added the two lines of code that I am using for this particular issue. Sorry about that!

rebelagentm commented Feb 1, 2016

@barancev I just added the two lines of code that I am using for this particular issue. Sorry about that!

@lukeis lukeis closed this in b034fd7 Feb 1, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment