Issue 5569 in selenium: Using PHANTOMJS_CLI_ARGS throws ClassCastException

39 views
Skip to first unread message

sele...@googlecode.com

unread,
Apr 29, 2013, 11:11:37 AM4/29/13
to selenium-develope...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium Status-Untriaged

New issue 5569 by claus.ch...@gmail.com: Using PHANTOMJS_CLI_ARGS throws
ClassCastException
http://code.google.com/p/selenium/issues/detail?id=5569


What steps will reproduce the problem?
1. Instantiate DesiredCapabilities.phantomjs()
2. Add Capability according to the java doc of
PhantomJSDriverService.PHANTOMJS_CLI_ARGS
3. Instantiate a RemoteWebDriver with this

What is the expected output? What do you see instead?
Expected: PhantomJSDriverService.PHANTOMJS_CLI_ARGS will be used
Actual: java.lang.ClassCastException: java.util.ArrayList cannot be cast to
[Ljava.lang.String;
at
org.openqa.selenium.phantomjs.PhantomJSDriverService.findCommandLineArguments(PhantomJSDriverService.java:276)

Root Cause:
- BeanToJsonConverter#convertObject is converting String[] to a JSONArray
- JsonToBeanConverter#convertList is converting a JSONArray to a List.
- PhantomJSDriverService#findCommandLineArguments is casting the List to a
String[]

Selenium version: 2.31.0
OS: any
Browser: phantomjs
Browser version: 1.9.0

--
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,
Apr 29, 2013, 1:23:15 PM4/29/13
to selenium-develope...@googlegroups.com
Updates:
Labels: Browser-PhantomJS Lang-Java

Comment #1 on issue 5569 by barancev: Using PHANTOMJS_CLI_ARGS throws
ClassCastException
http://code.google.com/p/selenium/issues/detail?id=5569

(No comment was entered for this change.)

sele...@googlecode.com

unread,
May 12, 2013, 4:41:10 PM5/12/13
to selenium-develope...@googlegroups.com
Updates:
Cc: detroniz...@gmail.com
Labels: -Lang-Java

Comment #2 on issue 5569 by barancev: Using PHANTOMJS_CLI_ARGS throws

sele...@googlecode.com

unread,
May 24, 2013, 11:25:36 PM5/24/13
to selenium-develope...@googlegroups.com

Comment #3 on issue 5569 by weber...@gmail.com: Using PHANTOMJS_CLI_ARGS
throws ClassCastException
http://code.google.com/p/selenium/issues/detail?id=5569

Same with Selenium 2.32.0.

sele...@googlecode.com

unread,
Jul 18, 2013, 12:50:37 PM7/18/13
to selenium-develope...@googlegroups.com
Updates:
Status: Invalid

Comment #4 on issue 5569 by detroniz...@gmail.com: Using PHANTOMJS_CLI_ARGS
throws ClassCastException
http://code.google.com/p/selenium/issues/detail?id=5569

The reason this happens is because you expect to be able to pass a List
where a String[] is MANDATORY.

You have even highlighted correctly what is going on.

Just provide an array of String instead of expecting the driver binding
library to do the casting.

Anyway, if you have further discussion on this OR you want to provide a
PullRequest to implement a "generalised" behaviour, please use the
GhostDriver project https://github.com/detro/ghostdriver as the PhantomJS
Driver is developed THERE and not within the Selenium project.
Reply all
Reply to author
Forward
0 new messages