From: nonSonoPaola <non...@gm...> - 2016-09-26 14:19:42
|
Hi, here you can find a sample file (I made some refactoring since friday evening, please move all files but chrome.html to a folder named resources). Now I get the following exception when running get_image_stream function from custom_js.js. Thanks, Laura ====== EXCEPTION START ======== EcmaError: lineNumber=[3] column=[0] lineSource=[<no source>] name=[TypeError] sourceName=[file:////Users/laura/work/dev/SKY_KPI-Monitoring-Tool/MonitoringToolReportFactory/etc/bug_conversione_svg2png/20160926/resources/shieldui-all.min.js] message=[TypeError: Cannot read property "width" from undefined (file:////Users/laura/work/dev/SKY_KPI-Monitoring-Tool/MonitoringToolReportFactory/etc/bug_conversione_svg2png/20160926/resources/shieldui-all.min.js#3)] com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot read property "width" from undefined (file:////Users/laura/work/dev/SKY_KPI-Monitoring-Tool/MonitoringToolReportFactory/etc/bug_conversione_svg2png/20160926/resources/shieldui-all.min.js#3) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run( JavaScriptEngine.java:921) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:628) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call( ContextFactory.java:515) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute( JavaScriptEngine.java:803) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute( JavaScriptEngine.java:779) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute( JavaScriptEngine.java:767) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible( HtmlPage.java:904) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScript( HtmlPage.java:869) at eu.discoveryreply.monitoringTool.serviceLayer.ReportingServices.generatePdfReport( ReportingServices.java:331) at eu.discoveryreply.monitoringTool.test.ReportFactoryTest.testGetPdfReport( ReportFactoryTest.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall( FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run( ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively( FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate( InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild( BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild( BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.internal.runners.statements.RunBefores.evaluate( RunBefores.java:26) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run( JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run( TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests( RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests( RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run( RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:192) Caused by: net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot read property "width" from undefined (file:////Users/laura/work/dev/SKY_KPI-Monitoring-Tool/MonitoringToolReportFactory/etc/bug_conversione_svg2png/20160926/resources/shieldui-all.min.js#3) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError( ScriptRuntime.java:3915) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError( ScriptRuntime.java:3899) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError( ScriptRuntime.java:3924) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2( ScriptRuntime.java:3940) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.undefReadError( ScriptRuntime.java:3951) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp( ScriptRuntime.java:1492) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop( Interpreter.java:1247) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret( Interpreter.java:800) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call( InterpretedFunction.java:105) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall( ContextFactory.java:413) at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall( HtmlUnitContextFactory.java:252) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall( ScriptRuntime.java:3264) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec( InterpretedFunction.java:115) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$3.doRun( JavaScriptEngine.java:794) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run( JavaScriptEngine.java:906) ... 33 more Enclosed exception: net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot read property "width" from undefined (file:////Users/laura/work/dev/SKY_KPI-Monitoring-Tool/MonitoringToolReportFactory/etc/bug_conversione_svg2png/20160926/resources/shieldui-all.min.js#3) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError( ScriptRuntime.java:3915) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError( ScriptRuntime.java:3899) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError( ScriptRuntime.java:3924) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2( ScriptRuntime.java:3940) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.undefReadError( ScriptRuntime.java:3951) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp( ScriptRuntime.java:1492) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop( Interpreter.java:1247) at script(file:////Users/laura/work/dev/SKY_KPI-Monitoring-Tool/MonitoringToolReportFactory/etc/bug_conversione_svg2png/20160926/resources/shieldui-all.min.js:3) at script(file:////Users/laura/work/dev/SKY_KPI-Monitoring-Tool/MonitoringToolReportFactory/etc/bug_conversione_svg2png/20160926/resources/shieldui-all.min.js:3) at script(file:////Users/laura/work/dev/SKY_KPI-Monitoring-Tool/MonitoringToolReportFactory/etc/bug_conversione_svg2png/20160926/resources/shieldui-all.min.js:3) at script(file:////Users/laura/work/dev/SKY_KPI-Monitoring-Tool/MonitoringToolReportFactory/etc/bug_conversione_svg2png/20160926/resources/shieldui-all.min.js:2) at script(file:////Users/laura/work/dev/SKY_KPI-Monitoring-Tool/MonitoringToolReportFactory/etc/bug_conversione_svg2png/20160926/resources/shieldui-all.min.js:2) at script(file:////Users/laura/work/dev/SKY_KPI-Monitoring-Tool/MonitoringToolReportFactory/etc/bug_conversione_svg2png/20160926/resources/shieldui-all.min.js:2) at script(file:////Users/laura/work/dev/SKY_KPI-Monitoring-Tool/MonitoringToolReportFactory/etc/bug_conversione_svg2png/20160926/resources/shieldui-all.min.js:2) at script(file:////Users/laura/work/dev/SKY_KPI-Monitoring-Tool/MonitoringToolReportFactory/etc/bug_conversione_svg2png/20160926/resources/shieldui-all.min.js:2) at script(file:////Users/laura/work/dev/SKY_KPI-Monitoring-Tool/MonitoringToolReportFactory/etc/bug_conversione_svg2png/20160926/resources/shieldui-all.min.js:3) at script(file:////Users/laura/work/dev/SKY_KPI-Monitoring-Tool/MonitoringToolReportFactory/etc/bug_conversione_svg2png/20160926/resources/shieldui-all.min.js:3) at script(file:////Users/laura/work/dev/SKY_KPI-Monitoring-Tool/MonitoringToolReportFactory/etc/bug_conversione_svg2png/20160926/resources/shieldui-all.min.js:3) at script(file:////Users/laura/work/dev/SKY_KPI-Monitoring-Tool/MonitoringToolReportFactory/etc/bug_conversione_svg2png/20160926/resources/shieldui-all.min.js:3) at script(file:////Users/laura/work/dev/SKY_KPI-Monitoring-Tool/MonitoringToolReportFactory/etc/bug_conversione_svg2png/20160926/resources/shieldui-all.min.js:12) at script.get_image_stream(file:////Users/laura/work/dev/SKY_KPI-Monitoring-Tool/MonitoringToolReportFactory/etc/bug_conversione_svg2png/20160926/resources/custom_js.js:14) at script(injected script:1) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret( Interpreter.java:800) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call( InterpretedFunction.java:105) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall( ContextFactory.java:413) at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall( HtmlUnitContextFactory.java:252) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall( ScriptRuntime.java:3264) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec( InterpretedFunction.java:115) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$3.doRun( JavaScriptEngine.java:794) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run( JavaScriptEngine.java:906) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:628) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call( ContextFactory.java:515) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute( JavaScriptEngine.java:803) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute( JavaScriptEngine.java:779) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute( JavaScriptEngine.java:767) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible( HtmlPage.java:904) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScript( HtmlPage.java:869) at eu.discoveryreply.monitoringTool.serviceLayer.ReportingServices.generatePdfReport( ReportingServices.java:331) at eu.discoveryreply.monitoringTool.test.ReportFactoryTest.testGetPdfReport( ReportFactoryTest.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall( FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run( ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively( FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate( InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild( BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild( BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.internal.runners.statements.RunBefores.evaluate( RunBefores.java:26) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run( JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run( TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests( RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests( RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run( RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:192) ======= EXCEPTION END ======== 2016-09-24 11:42 GMT+02:00 Ronald Brill <rb...@rb...>: > On Fri, 23 Sep 2016 21:36:31 +0200 nonSonoPaola wrote: > > > >Hi, > >Is there any way of parsing a page that contains a setTimeout instruction? > > In general: > Yes, HtmlUnit can handle every page a common browser can handle. And if > not - you found a bug and we have to work on. > > To be more specific: > You have to provide a bit more info. Why do you think it does not work? > Can you provide the page source and your source code to give us an > impression of > your problem. > > > > RBRi > -------------------------- > WETATOR > Smart web application testing > http://www.wetator.org > |