I want to run UI Tests using selenium (WebDriver) as different user.
string[] rolesArray = {"Admin", "Manager"};
Thread.CurrentPrincipal = new GenericPrincipal(new GenericIdentity("ik\adam.walas@com.pl"), rolesArray);
I put these code inside constructor WebDriver
. However when I run single UI Test using Visual Studio, the test runs as a user who is logged on computer so my account. How can I solve this issue? I use Chrome
as a browser for UI Tests. Should I use selenium chromedriver with ChromeOptions
to workaround this?