From: Dan S. <re...@bu...> - 2009-08-24 12:09:36
|
New submission from Dan Salagean <dan...@ya...>: Environment: Windows XP SP3, JRE 1.6.0_16, jython 2.5.0 If the java method receives a java.lang.CharSequence parameter, it is not coerced by the Jython. As a workaround you could use java.lang.String, but it does not work. See the example below, using WebDriver (http://code.google.com/p/webdriver/). D:\webDriver>set CLASSPATH=d:\webDriver\json- 20080701.jar;d:\webDriver\junit-3.8.1.jar;d:\webDriver\webdriver-all.jar D:\webDriver>jython *sys-package-mgr*: processing new jar, 'C:\jython2.5.0\jython.jar' *sys-package-mgr*: processing new jar, 'D:\webDriver\json-20080701.jar' *sys-package-mgr*: processing new jar, 'D:\webDriver\junit-3.8.1.jar' *sys-package-mgr*: processing new jar, 'D:\webDriver\webdriver-all.jar' *sys-package-mgr*: processing new jar, 'C:\JRE1.6\lib\resources.jar' *sys-package-mgr*: processing new jar, 'C:\JRE1.6\lib\rt.jar' *sys-package-mgr*: processing new jar, 'C:\JRE1.6\lib\jsse.jar' *sys-package-mgr*: processing new jar, 'C:\JRE1.6\lib\jce.jar' *sys-package-mgr*: processing new jar, 'C:\JRE1.6\lib\charsets.jar' *sys-package-mgr*: processing new jar, 'C:\JRE1.6\lib\ext\dnsns.jar' *sys-package-mgr*: processing new jar, 'C:\JRE1.6 \lib\ext\localedata.jar' *sys-package-mgr*: processing new jar, 'C:\JRE1.6 \lib\ext\sunjce_provider.jar' *sys-package-mgr*: processing new jar, 'C:\JRE1.6\lib\ext\sunmscapi.jar' *sys-package-mgr*: processing new jar, 'C:\JRE1.6\lib\ext\sunpkcs11.jar' Jython 2.5.0 (Release_2_5_0:6476, Jun 16 2009, 13:33:26) [Java HotSpot(TM) Client VM (Sun Microsystems Inc.)] on java1.6.0_16 Type "help", "copyright", "credits" or "license" for more information. >>> from org.openqa.selenium.firefox import FirefoxDriver >>> from org.openqa.selenium import By >>> from java.lang import String >>> >>> driver = FirefoxDriver() >>> driver.get("http://www.google.com") >>> driver.findElement(By.name("q")).sendKeys( String( "myvalue" ) ) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: sendKeys(): 1st arg can't be coerced to java.lang.CharSequence[] >>> ---------- components: None messages: 5062 nosy: dsalagean severity: major status: open title: 1st arg can't be coerced to java.lang.CharSequence[] even when using workaround type: behaviour versions: 2.5.0 _______________________________________ Jython tracker <re...@bu...> <http://bugs.jython.org/issue1446> _______________________________________ |