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
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
Test Studio Trainings
Thanks for the feedback! I am pleased to know that worked for you!
Regards,
Elena Tsvetkova
Progress Telerik
Test Studio Trainings
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
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
Test Studio Trainings
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.
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
Test Studio Trainings
Hi Nikolai
i will try re-install the telerik testing framework plugin and also add the innerException.
thank you for the explanation.
hi nikolai
thanks for the explanation.
it worked after adding the test studio and exception.
Thanks for the feedback! We are glad to know we were helpful!
Regards,
Elena Tsvetkova
Progress Telerik
Test Studio Trainings