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

InvokeScript method not working in Edge

6 Answers 89 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 25 May 2017, 10:33 PM
I get an error message when trying to use the InvokeScript method in Edge.  It works in all other browsers but Edge.  Am I missing a browser setting somewhere? I can open the development tools in Edge and run the same javascript in the console that I am passing to the InvokeScript method and it works fine.

6 Answers, 1 is accepted

Sort by
0
Nikolai
Telerik team
answered on 26 May 2017, 02:23 PM
Hi Jeff,

I've tried some simple code like this: 

this.Log.WriteLine(this.ActiveBrowser.Actions.InvokeScript("location.href"));

and worked fine. Can you please share your code so we can test/debug it locally? 

Regards,
Nikolai
Progress Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Jeff
Top achievements
Rank 1
answered on 26 May 2017, 05:00 PM

Here is some of the code that is failing when using the InvokeScript method.  cw is my ActiveBrowser.  This code works on all browsers except Edge.

        public void Actual_Finish(string date)
        {
            cw.Actions.InvokeScript("$('#ctl00_Main_calActualFinishDate').val(new Date('" + date + "'))");
            
        }

 

 

 

0
Jeff
Top achievements
Rank 1
answered on 26 May 2017, 06:52 PM

This is the error I am seeing. 

 

"An exception of type 'ArtOfTest.WebAii.Exceptions.ExecuteCommandException' occurred in ArtOfTest.WebAii.dll but was not handled in user code"

0
Nikolai
Telerik team
answered on 29 May 2017, 07:46 AM
Hello Jeff,

Since you are relying on jQuery you will need more time so that the Edge engine can properly load all dependencies, I've tried this against the Kendo jQuery demos and everything worked fine:

this.ActiveBrowser.NavigateTo("http://demos.telerik.com/kendo-ui/dateinput/index");           
System.Threading.Thread.Sleep(5000);
this.ActiveBrowser.Actions.InvokeScript("$(\"#dateinput\").val(\"5.5.2017\");");           
System.Threading.Thread.Sleep(5000);


Regards,
Nikolai
Progress Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Jeff
Top achievements
Rank 1
answered on 06 Jun 2017, 06:27 PM
It still does not work.
0
Nikolay Petrov
Telerik team
answered on 09 Jun 2017, 03:16 PM
Hi Jeff,

It seems then that the problem is an application specific one. Could you provide a sample app that reproduce the problem to investigate it, please?

Kind Regards,
Nikolay Petrov
Progress Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Jeff
Top achievements
Rank 1
Answers by
Nikolai
Telerik team
Jeff
Top achievements
Rank 1
Nikolay Petrov
Telerik team
Share this question
or