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

Issue with Javascript Events

8 Answers 150 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bhaskar
Top achievements
Rank 1
Bhaskar asked on 25 Jan 2013, 06:30 AM
Hi,

    In my form I have two drop-downs. When i Select a value from first drop-down the second one should get enabled.

While playback the first drop-down selection is done but it is throwing a exception.

Below are the Exception Details :
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_4296c26d-43a3-4f94-aca4-9e154a7ca4db',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.


 I tried to fire Javascript/jquery events using coded step but nothing solved my problem.

Can you please help me with this issue?

Thanks
Bhaskar

8 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 25 Jan 2013, 08:34 AM
Hi Bhaskar,

To overcome this, go to the Step Properties pane and find the TriggerjQueryEvent and InvokeSelectionChanged properties. Set both properties to True and the issue should be resolved. 

The TriggerjQueryEvent step property is included in our latest official release(version 2012.2.1204), so if you haven't done so already please upgrade to that version of Test Studio. You can download it from your Telerik.com account.

Regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Bhaskar
Top achievements
Rank 1
answered on 25 Jan 2013, 09:01 AM
Hi plamen,

   I have made bothTriggerjQueryEvent and InvokeSelectionChanged properties to true. But still facing the same issue.

Is there any other work around for this?

Thanks
Bhaskar

0
Plamen
Telerik team
answered on 25 Jan 2013, 09:30 AM
Hello Bhaskar,

I am sorry to hear it is still not working. We'll need to reproduce the issue locally in order to continue troubleshooting and find a workable solution for you. Please provide us with a copy of your test and access to your application. If it is not possible to grant us access to your application, please take a Fiddler trace using FiddlerCap and send it to us 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
0
Plamen
Telerik team
answered on 20 Feb 2013, 01:34 PM
Hello Bhaskar,

I just want to inform you that this issue is already fixed and the fix is included in our 2012 R2 SP2 release(2012.2.1420). You can download it from your Telerik.com account here: Public URL.

Greetings,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Dave
Top achievements
Rank 1
answered on 21 Nov 2016, 07:50 PM

Hi, I am getting the same error message on one of my drop downs and I have set the InvokeSelectionChanged property to true but I don't see a TriggerQueryEvent property.

Please advise.  Thanks,

  Dave

0
Elena
Telerik team
answered on 24 Nov 2016, 08:59 AM
Hello Dave,

Please note that you are addressing a post since almost 4 years and especially for that specific area this is quite long time to rely on older posts. There are plenty of changed and newly implemented features in both Telerik Test Studio and the supported browsers. 

I would like to ask you for further details and possibly a sample web application to test it on our end. Thanks for your understanding! 

Regards,
Elena Tsvetkova
Telerik by Progress
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Roland
Top achievements
Rank 1
answered on 16 Mar 2017, 01:36 PM

Hi Elena,

My code just produced the same error when I tried to call the FindItemIndexByText method of Telerik.WebAii.Controls.Html.RadComboBox element.

I´m using the latest Telerik Testing Framework + latest version of Chrome, the test was running on Chrome.

Here is a sample code snipplet from my test function, please use it for reproduction:

RerouteInstanceDialog rerouteDialog = new RerouteInstanceDialog(dialogName);         // RerouteInstanceDialog is a WndDialog  RadComboBox myComboBox= rerouteDialog.RerouteToComboBox;                              // myComboBoxitem is successfully found     

myComboBox.SelectItemByIndex(3);            // successfully executed

myComboBox.ShowDropDown();            // successfully executed

int i = myComboBox.FindItemIndexByText("End");   // reaching this line will throw the given exception.

myComboBox.SelectItemByText("End");      // this line would also fail if I use this.

 

Note 1: "End" is a real entry of the dropdown.

Note 2: Using the exact same approach for another dropboxes located on another dialogs works fine, the same piece of code is executed successfully. Since I can´t find any difference in my code, I´d like to understand why SelectItemByText and FindItemIndexByText sometimes throw an error, sometimes not.

 

Here is the exact error I get:

   ExecuteCommand failed!
InError set by the client. Client Error:
Cannot read property 'findItemByValue' of null
BrowserCommand (Type:'Action',Info:'NotSet',Action:'InvokeJsFunction',Target:'ElementId (tagName: '',occurrenceIndex: '-1')',Data:'$find('cmbxReroute').findItemByText('End').get_index()',ClientId:'3a866dbd-8501-4f6a-bbac-97de907136ef',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'4',InError:'True',Response:'Cannot read property 'findItemByValue' of null')
InnerException: none.

Please advise us something!

Best regards,

Zsolt

 

 

 

0
Elena
Telerik team
answered on 20 Mar 2017, 05:04 PM
Hello Zsolt,

Please note that you refer to quite an old post and the version you have in use currently probably behaves different. it should be noted as well that the browser versions and the way they work back then and now are also rather different. 

Reading the details you shared it seems that the issue might be related to some specifics of the application under test. Please consider submitting a support ticket and sharing further details about the drop downs
against which the code works and these that are throwing exceptions - what is the difference in these drop downs code, etc. 

Thanks for your understanding! 

Regards,
Elena Tsvetkova
Telerik by Progress
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Bhaskar
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Bhaskar
Top achievements
Rank 1
Dave
Top achievements
Rank 1
Elena
Telerik team
Roland
Top achievements
Rank 1
Share this question
or