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

Javascript error from selecting a dropdown item

2 Answers 51 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Hamza
Top achievements
Rank 1
Hamza asked on 22 Jul 2015, 06:36 PM

Hello all,

I am getting a JS error when the test select a value from a dropdown list. The change triggers a JS call.
I am getting an error when that happens (error below).
 
Any help will be much appreciated!
 
Thank in advance.

 

ExecuteCommand failed!
InError set by the client. Client Error:
System.InvalidOperationException: Javascript call [$(document.getElementsByTagName(\'select\')[0]).change();] failed! Please make sure the function exists and the call is using the correct prototype signature. Javascript error: TypeError: Unable to get property 'srcElement' of undefined or null reference
   at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeFunction(String functionCall, Boolean useEval, Boolean returnJSON)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommandInternal(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)
BrowserCommand (Type:'Action',Info:'NotSet',Action:'InvokeJsFunction',Target:'ElementId (tagName: '',occurrenceIndex: '-1')',Data:'$(document.getElementsByTagName(\'select\')[0]).change();',ClientId:'Client_07aa2aef-775f-4ce0-b4c9-fb679c33e1e5',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'System.InvalidOperationException: Javascript call [$(document.getElementsByTagName(\'select\')[0]).change();] failed! Please make sure the function exists and the call is using the correct prototype signature. Javascript error: TypeError: Unable to get property 'srcElement' of undefined or null reference
   at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeFunction(String functionCall, Boolean useEval, Boolean returnJSON)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommandInternal(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)')
InnerException: none.

2 Answers, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 27 Jul 2015, 11:29 AM
Hi Hamza,

What version of Test Studio do you use?

Could you please try adding a WaitForExists step for that drop down list.

If the issue persists is there a possibility to grant us a direct access to your application so we can reproduce this.

Hope to hear from you soon.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
İsmail Yusuf
Top achievements
Rank 1
answered on 28 Jul 2015, 02:57 PM

Hi, 

I don't know what your problem exactly. However, while working on dropdown lists, using index property of dd lists is better than value property. You can try your test with index property of dropdown list.

Tags
General Discussions
Asked by
Hamza
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
İsmail Yusuf
Top achievements
Rank 1
Share this question
or