Friday, March 23, 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

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...