This is a migrated thread and some comments may be shown as answers.

Java script exception while handling the dropdown

1 Answer 72 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Venugopal
Top achievements
Rank 1
Venugopal asked on 23 Jan 2013, 11:43 AM
I have a drop down while selecting the drop down i am facing below java script exception, i could not find what was the reason behind this test case failure.

See the below log for the reference:
'23-01-2013 15:27:35' - 'Pass' : 11. Wait for '3000' msec.
'23-01-2013 15:27:36' - 'Fail' : 12. Select 'ByText' option 'Main Phone' on 'Selector11Select'
------------------------------------------------------------
Failure Information: 
~~~~~~~~~~~~~~~
ExecuteCommand failed!
InError set by the client. Client Error:
System.InvalidOperationException: Javascript call [function fireChanged(){var el=document.getElementsByTagName(\'select\')[0]; if(el._events == null || el._events.change == null){return;} var hndlr = el._events.change.length;for(i=0; i<hndlr;i++){el._events.change[i].handler();}}fireChanged()] failed! Please make the function exists and the call is using the correct prototype signature. Javascript error: TypeError: Unable to get value of the property 'target': object is null or undefined 
   at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeFunction(String functionCall, Boolean useEval, Boolean returnJSON)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)
BrowserCommand (Type:'Action',Info:'NotSet',Action:'InvokeJsFunction',Target:'ElementId (tagName: '',occurrenceIndex: '-1')',Data:'function fireChanged(){var el=document.getElementsByTagName(\'select\')[0]; if(el._events == null || el._events.change == null){return;} var hndlr = el._events.change.length;for(i=0; i<hndlr;i++){el._events.change[i].handler();}}fireChanged()',ClientId:'Client_1c6001b8-7745-4671-bcbb-ce305fcb41e3',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'0',InError:'True',Response:'System.InvalidOperationException: Javascript call [function fireChanged(){var el=document.getElementsByTagName(\'select\')[0]; if(el._events == null || el._events.change == null){return;} var hndlr = el._events.change.length;for(i=0; i<hndlr;i++){el._events.change[i].handler();}}fireChanged()] failed! Please make the function exists and the call is using the correct prototype signature. Javascript error: TypeError: Unable to get value of the property 'target': object is null or undefined 
   at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeFunction(String functionCall, Boolean useEval, Boolean returnJSON)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)')
InnerException: none.

InnerException:
ArtOfTest.WebAii.Exceptions.ExecuteCommandException: ExecuteCommand failed!
InError set by the client. Client Error:
System.InvalidOperationException: Javascript call [function fireChanged(){var el=document.getElementsByTagName(\'select\')[0]; if(el._events == null || el._events.change == null){return;} var hndlr = el._events.change.length;for(i=0; i<hndlr;i++){el._events.change[i].handler();}}fireChanged()] failed! Please make the function exists and the call is using the correct prototype signature. Javascript error: TypeError: Unable to get value of the property 'target': object is null or undefined 
   at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeFunction(String functionCall, Boolean useEval, Boolean returnJSON)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)
BrowserCommand (Type:'Action',Info:'NotSet',Action:'InvokeJsFunction',Target:'ElementId (tagName: '',occurrenceIndex: '-1')',Data:'function fireChanged(){var el=document.getElementsByTagName(\'select\')[0]; if(el._events == null || el._events.change == null){return;} var hndlr = el._events.change.length;for(i=0; i<hndlr;i++){el._events.change[i].handler();}}fireChanged()',ClientId:'Client_1c6001b8-7745-4671-bcbb-ce305fcb41e3',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'0',InError:'True',Response:'System.InvalidOperationException: Javascript call [function fireChanged(){var el=document.getElementsByTagName(\'select\')[0]; if(el._events == null || el._events.change == null){return;} var hndlr = el._events.change.length;for(i=0; i<hndlr;i++){el._events.change[i].handler();}}fireChanged()] failed! Please make the function exists and the call is using the correct prototype signature. Javascript error: TypeError: Unable to get value of the property 'target': object is null or undefined 
   at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeFunction(String functionCall, Boolean useEval, Boolean returnJSON)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)')
InnerException: none.

   at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request)
   at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request, Boolean performDomRefresh, Boolean waitUntilReady)
   at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request)
   at ArtOfTest.WebAii.Core.Actions.InvokeScript(String script)
   at ArtOfTest.WebAii.BrowserSpecialized.InternetExplorer.InternetExplorerActions.InvokeScript(String script)
   at ArtOfTest.WebAii.Controls.HtmlControls.HtmlSelect.InvokeOnChange()
   at ArtOfTest.WebAii.Controls.HtmlControls.HtmlSelect.SelectByText(String text, Boolean invokeOnChangeEvent)
   at ArtOfTest.WebAii.Design.IntrinsicTranslators.Descriptors.SelectDropDownActionDescriptor.Execute(Browser browser)
   at ArtOfTest.WebAii.Design.Extensibility.HtmlActionDescriptor.Execute(IAutomationHost autoHost)
   at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteStep(Int32 order)

Can you please guide me what can be done to make the test case work?


1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 23 Jan 2013, 12:33 PM
Hello Venugopal,

This error is consistent with a step executing against an incorrect element that does not implement the function used by the correct element. This could be a problem with the element identification. You may be able to resolve this issue by comparing the find logic for the target element to the DOM on Failure. If the error does not appear to be caused by an identification mistake, you may be able to work around it by recording a Blind Mouse Click on the target element instead.

If these steps do not resolve your issue, we will need more information about your test scenario. Please provide us with a copy of your test and access to your application. Also, please provide your failure log and a copy of the DOM at the time of failure. You can export these to file from the failure tab for your test and add them to a .zip archive. If it is not possible to grant us access to your application, please capture a Fiddler trace using FiddlerCap and attach it in a zip file. A Jing video demonstrating the issue may also help us to better understand what is happening. If you deem that information too sensitive for this forum, you can create a support ticket and attach it there. Thanks for providing the information we need to best assist you.

Kind regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Venugopal
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or