Friday, 23 March 2018

asp.net - Selenium tests class library app.config appSettings ignored

Answer


Answer




I am testing an ASP.Net MVC web application using selenium and i would like to use the app settings in the app.config of the test project instead of those in the web.config of the actual web application. However they appear to be getting ignored. This is how they appear in both config files (obviously with different values)














The above are the appsettings and values from the test project, but these are not being used, instead the values from the web.config file are being used.



Can someone help me to solve this problem and have it so that the settings from the app.config from the test project are used instead?


Answer



In the end, i used selenium to set the JavaScript variables (containing the values from the config file) directly using:



((IJavaScriptExecutor)driver).ExecuteScript("myJsVariable = 5;");

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...