Open namurdock opened 2 years ago
I am using the default TestSettings.Options and default MFA login public static BrowserOptions SharedOptions = new BrowserOptions { BrowserType = (BrowserType)Enum.Parse(typeof(BrowserType), Type), PrivateMode = UsePrivateMode, FireEvents = false, Headless = false, UserAgent = false, DefaultThinkTime = 2000, RemoteBrowserType = (BrowserType)Enum.Parse(typeof(BrowserType), RemoteType), RemoteHubServer = new Uri(RemoteHubServerURL), UCITestMode = true, UCIPerformanceMode = true, DriversPath = Path.IsPathRooted(DriversPath) ? DriversPath : Path.Combine(Directory.GetCurrentDirectory(), DriversPath), DisableExtensions = false, DisableFeatures = false, DisablePopupBlocking = false, DisableSettingsWindow = false, EnableJavascript = false, NoSandbox = false, DisableGpu = false, DumpDom = false, EnableAutomation = false, DisableImplSidePainting = false, DisableDevShmUsage = false, DisableInfoBars = false, TestTypeBrowser = false };
var client = new WebClient(TestSettings.Options); if (TestSettings.Options.Headless) client.Browser.Driver.Manage().Window.Size = new Size(1920, 1080); using (var xrmApp = new XrmApp(client)) { xrmApp.OnlineLogin.Login(_xrmUri, _username.ToSecureString(), _password.ToSecureString());
I made this change in BrowserOptions.cs
public virtual EdgeOptions ToEdge() { var options = new EdgeOptions()
{
PageLoadStrategy = PageLoadStrategy.Normal,
};
options.AddArgument("InPrivate");
return options;
}
I also had to copy the latest msedgedriver.exe iinto my solution and set to always copy to Output Directory
It seems to work for me, except my account using MFA must have certain security parameters.
We are also facing the same issue. Unable to login through "InPrivate" mode in Edge, but in "Chrome" it's working fine. Also not able to implement the above solution ( options.AddArgument("InPrivate"); ) because "AddArgument" is not included in "EdgeOptions" and "EdgeOptions" is a metadata file so there is no option to edit.
Could someone help us with the solution?
Bug Report
Issues should only be created for items related to covered functionality.
Not covered functionality, feature requests, and questions should use the Feature Request or Question templates.
EasyRepro Version
UCI or Classic Web
Online or On Premise
Browser
Describe the bug
All packages from NuGet:
Dynamics365.UIAutomation.Api: 9.2.21111.116-RW2-Preview Selenium.Support: 4.1.0 Selenium.WebDriver: 4.1.0
Note: When specifying Chrome as my browser everything works as expected.
When specifying Edge as my browser type the following code produces an error:
Where TestSettings.Options is:
Special formatting / display
Code to reproduce
Error returned by xrmApp.OnlineLogin.Login(new Uri(url), user.ToSecureString(), pass.ToSecureString());
Expected behavior
Expected behaviour is for a new Edge browser to launch in "Private" mode.
Screenshots
Additional context