Javascript error from selecting a dropdown item

3 posts, 0 answers
  1. Hamza
    Hamza avatar
    3 posts
    Member since:
    Jul 2015

    Posted 22 Jul 2015 Link to this post

    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. Boyan Boev
    Admin
    Boyan Boev avatar
    1072 posts

    Posted 27 Jul 2015 Link to this post

    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!
  3. İsmail Yusuf
    İsmail Yusuf avatar
    15 posts
    Member since:
    Jun 2015

    Posted 28 Jul 2015 Link to this post

    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.

Back to Top