c# - Can I change the database when using selenium? -
i have main project database (and corresponding connection string in web.config). furthermore, test project separate test database (and corresponding connection string in app.config of test project). use test database tests.
when run selenium tests iisexpress server uses "main connection string" in web.config instead of "test connection string" in app.config. there anyway tell controller is running in test mode , use different connection string?
i using following setup selenium , iis running:
_iisprocess = new process { startinfo = { filename = ....iis express\iisexpress.exe, arguments = $"/path:\"{_applicationpath}\" /port:{_iisport}" } }; _iisprocess.start(); chromedriver = new chromedriver();
perhaps can pass variable iis start, can use change connection string when opening database connection?
i tried use global variable, not work test , selenium instance running on separate instances. value not passed across.
Comments
Post a Comment