searls / jasmine-maven-plugin

Maven plugin to execute Jasmine Specs. Creates your HTML runners for you, runs headlessly, outputs JUnit XML
http://searls.github.io/jasmine-maven-plugin
Other
289 stars 163 forks source link

[Cannot find function setProperty in object] run with WebDriver org.openqa.selenium.htmlunit.HtmlUnitDriver #205

Closed hunglu closed 3 years ago

hunglu commented 10 years ago

Hi all,

I got this error when use webdriverclassname is org.openqa.selenium.htmlunit.HtmlUnitDriver

Does any one solve this one ? in HTMLUnit site, I saw they was fixed this in the latest version. Does this plugin include the latest version of it ?

[INFO] Executing Jasmine Specs Nov 14, 2013 11:19:55 AM com.gargoylesoftware.htmlunit.javascript.background.JavaScriptJobManagerImpl runSingleJob SEVERE: Job run failed with unexpected RuntimeException: TypeError: Cannot find function setProperty in object [object C SSStyleDeclaration]. (http://localhost:55501/src/test/lib/sencha-touch-all-debug.js#14053) ======= EXCEPTION START ======== EcmaError: lineNumber=[14053] column=[0] lineSource=[null] name=[TypeError] sourceName=[http://localhost:55501/src/test/ lib/sencha-touch-all-debug.js] message=[TypeError: Cannot find function setProperty in object [object CSSStyleDeclaratio n]. (http://localhost:55501/src/test/lib/sencha-touch-all-debug.js#14053)] com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function setProperty in object [object CSSStyleDec laration]. (http://localhost:55501/src/test/lib/sencha-touch-all-debug.js#14053)

Thanks,

klieber commented 10 years ago

@hunglu are you still having this issue? If so, could you please provide a minimal sample project that recreates the bug? Thanks!

ryan-chambers commented 10 years ago

I got an error that might be similar for my sample project when running the maven build. When running maven jasmine:bdd and viewing through the browser, all the tests pass.

Here is the maven error.

ERROR] Failed to execute goal com.github.searls:jasmine-maven-plugin:1.3.1.4:test (default) on project maven-jasmine-sample-project: The jasmine-maven-plugin encountered an exception: [ERROR] java.lang.RuntimeException: org.openqa.selenium.WebDriverException: com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot call method "getAttribute" of undefined (script in http://localhost:63769/ from (6, 34) to (15, 12)#8) [ERROR] Build info: version: '2.39.0', revision: '14fa800511cc5d66d426e08b0b2ab926c7ed7398', time: '2013-12-16 13:18:38' [ERROR] System info: host: 'ZZZZZ', ip: '10.10.x.x', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.6.8', java.version: '1.6.0_65' [ERROR] Driver info: driver.version: HtmlUnitDriver [ERROR] at com.github.searls.jasmine.runner.SpecRunnerExecutor.execute(SpecRunnerExecutor.java:46) [ERROR] at com.github.searls.jasmine.mojo.TestMojo.executeSpecs(TestMojo.java:85) [ERROR] at com.github.searls.jasmine.mojo.TestMojo.run(TestMojo.java:53) [ERROR] at com.github.searls.jasmine.mojo.AbstractJasmineMojo.execute(AbstractJasmineMojo.java:470) [ERROR] at com.github.searls.jasmine.mojo.TestMojo.execute(TestMojo.java:40) [ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) [ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) [ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) [ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) [ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [ERROR] at java.lang.reflect.Method.invoke(Method.java:597) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) [ERROR] Caused by: org.openqa.selenium.WebDriverException: com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot call method "getAttribute" of undefined (script in http://localhost:63769/ from (6, 34) to (15, 12)#8)

mborra commented 10 years ago

Hi, I have the same problem of @ryan-chambers

MuppetGate commented 10 years ago

Seeing the same error described by @ryan-chambers

urbas commented 10 years ago

I've got exactly the same problem. Any ideas for a solution?

ghost commented 10 years ago

I had this same issue, in my case the cause appeared to be a conflict when preloading angular-mocks.js for my tests.
I found a hint here that worked for my case: http://stackoverflow.com/questions/17675261/angular-mock-js-conflicts-with-htmlunit-how-to-test-angular-application-using-a I.e. I preloaded jquery prior to angular at the top of the preloadSources element in the plugin configuration.

mwanji commented 9 years ago

I'm having a similar problem:

net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot find function bind in object function (type, props, children) {...}. (http://localhost:43065/webjars/react-with-addons.js#10254)

It runs fine in the browser and with FirefoxDriver. The only reference I can find to this problem is a bug report that was fixed in 2008!

I'm running 2.0-alpha01 with selenium 2.44.0 (2.41.0 doesn't work with the current version of Firefox) and htmlunit 2.15 (current latest htmlunit).

github-actions[bot] commented 3 years ago

This issue has been marked as stale because it has not been updated in 60 days. Please add a comment or this will be closed in 7 days.

github-actions[bot] commented 3 years ago

This issue was closed because it has been stalled for 7 days with no updates.