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

Exception in ArtOfTest.WebAii

10 Answers 575 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
imran
Top achievements
Rank 1
imran asked on 14 Mar 2018, 05:02 PM

I am getting this exception while automating using ArtOfTest.WebAii in VS2017, what could be the reason.

threw exception: 
System.TypeInitializationException: The type initializer for 'ArtOfTest.WebAii.Core.Settings' threw an exception. 
---> System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, 
Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.

10 Answers, 1 is accepted

Sort by
0
Accepted
Elena
Telerik team
answered on 16 Mar 2018, 04:10 PM
Hi Imran,

Thank you for reaching us out. 

Could you please add the NewtonSoft.Json.dll into GAC. Please use the dll which is deployed with the Testing Framework installation - it could be found in the bin folder. The default installation path is C:\Program Files (x86)\Telerik\Test Studio\Bin if you have upgraded the product and C:\Program Files (x86)\Progress\Test Studio\Bin if you have performed a new installation. 

You could double check the version of the dll in the bin folder and if it is the same as the one listed in the exception. 

I hope this will work for you as well. Though in case of questions please let me know! 

Regards,
Elena Tsvetkova
Progress Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
imran
Top achievements
Rank 1
answered on 19 Mar 2018, 09:52 AM
Thank You. It worked after adding to GAC.
0
Elena
Telerik team
answered on 19 Mar 2018, 03:11 PM
Hi Imran,

Thanks for the feedback! I am pleased to know that worked for you! 

Regards,
Elena Tsvetkova
Progress Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Farhaan
Top achievements
Rank 1
answered on 11 Sep 2018, 12:20 PM

hello Elena

can you please help me to fix this "The type initializer for 'ArtOfTest.WebAii.Core.Settings' threw an exception."

and how to use "settings mysettings = new settings();"

if there are any reference to add or nuget package..

Thanks 

 

0
Elena
Telerik team
answered on 13 Sep 2018, 12:32 PM
Hi Farhaan,

Thank you for reaching us out. 

Could you please provide the code that generates the listed error? It will be also helpful if you copy the whole message of the error if it contains any other information. 

Please also let me know which is the version of Test Studio you are using and which Visual Studio you have on your machine? 

Thanks in advance!

Regards,
Elena Tsvetkova
Progress Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Farhaan
Top achievements
Rank 1
answered on 13 Sep 2018, 06:06 PM

hello elena 

i am using visual studio 2015

this is the code:

Settings mySettings = new Settings();
            mySettings.Web.DefaultBrowser = BrowserType.InternetExplorer;
            mySettings.UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle;
            Manager myManager = new Manager(mySettings);

and it getting only this error : The type initializer for 'ArtOfTest.WebAii.Core.Settings' threw an exception.

i have copy paste the ArtOfTest.WebAii in the debug folder and add the reference to my project.

thanking you if you could help me.

       

0
Nikolai
Telerik team
answered on 14 Sep 2018, 12:32 PM
Hi Farhaan,

Based on your explanation it seems that you have referenced the ArtOfTest.WebAii.dll and ArtOfTest.WebAii.Design.dll but have you installed the Telerik Testing Framework/Test Studio on your machine or just copy/pasted the dlls? The error is usually associated with either missing or broken installation. Can you please re-install and try again?
Also there should be an InnerException for why the .net Runtime fails to load Settings type. 

Hope this helps!

Regards,
Nikolai
Progress Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Farhaan
Top achievements
Rank 1
answered on 17 Sep 2018, 05:48 AM

Hi Nikolai 

i will try re-install the telerik testing framework  plugin and also add the innerException.

thank you for the explanation.

0
Farhaan
Top achievements
Rank 1
answered on 18 Sep 2018, 06:34 AM

hi nikolai

thanks for the explanation.

it worked after adding the test studio and exception.

0
Elena
Telerik team
answered on 18 Sep 2018, 03:04 PM
Hi Farhaan,

Thanks for the feedback! We are glad to know we were helpful! 

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