我想使用selenium(WebDriver)作为不同的用户运行UI测试。
string[] rolesArray = {"Admin", "Manager"};
Thread.CurrentPrincipal = new GenericPrincipal(new GenericIdentity("ik\adam.walas@com.pl"), rolesArray);
我将这些代码放在构造函数WebDriver
中。但是,当我使用Visual Studio运行单个UI测试时,测试将作为登录计算机的用户运行,因此我的帐户。我该如何解决这个问题?我使用Chrome
作为UI测试的浏览器。我应该使用ChromeOptions
的硒氯化物来解决这个问题吗?