public BrowserCommandResult <string> OpenCapacity() { BrowserCommandOptions openAnalyticsCommandOptions = new BrowserCommandOptions(); openAnalyticsCommandOptions.CommandName = "Open Analytics Pane"; openAnalyticsCommandOptions.RetryAttempts = 3; openAnalyticsCommandOptions.RetryDelay = 1000; openAnalyticsCommandOptions.ThrowExceptions = true; openAnalyticsCommandOptions.ExceptionTypes = new List <Type>(); openAnalyticsCommandOptions.ExceptionTypes.Add(typeof(OpenAnalyticsPaneNotAvailableException)); openAnalyticsCommandOptions.ExceptionAction = HandleAnalyticsPaneExceptionsGracefully; return(_client.Execute(openAnalyticsCommandOptions, driver => { var chosenEnvironment = ""; var ResourcesButton = driver.WaitUntilAvailable(By.XPath(Elements.Xpath[Reference.Capacity.OpenResources])); //Expand Analytics ResourcesButton.Click(); var capacityButton = driver.WaitUntilAvailable(By.XPath(Elements.Xpath[Reference.Capacity.OpenCapacity])); try { capacityButton.Click(); } catch (Exception ex) { //throw new OpenAnalyticsPaneNotAvailableException(ex, "CDS Option not available to click"); } return chosenEnvironment; })); }
//public OnlineLogin(InteractiveBrowser browser, params string[] onlineDomains) // : this() //{ // this.OnlineDomains = onlineDomains; //} //public BrowserCommandResult<LoginResult> Login() //{ // return this.Login(new Uri(Constants.DefaultLoginUri)); //} //public BrowserCommandResult<LoginResult> Login(SecureString username, SecureString password) //{ // return this.Execute(GetOptions("Login"), this.Login, new Uri(Constants.DefaultLoginUri), username, password, default(Action<LoginRedirectEventArgs>)); //} //public BrowserCommandResult<LoginResult> Login(SecureString username, SecureString password, Action<LoginRedirectEventArgs> redirectAction) //{ // return this.Execute(GetOptions("Login"), this.Login, new Uri(Constants.DefaultLoginUri), username, password, redirectAction); //} //public BrowserCommandResult<LoginResult> Login(Uri uri) //{ // if (this.Browser.Options.Credentials.IsDefault) // throw new InvalidOperationException("The default login method cannot be invoked without first setting credentials on the Browser object."); // return this.Execute(GetOptions("Login"), this.Login, uri, this.Browser.Options.Credentials.Username, this.Browser.Options.Credentials.Password, default(Action<LoginRedirectEventArgs>)); //} /// <summary> /// Login Page /// </summary> /// <param name="uri">The Uri</param> /// <param name="username">The Username to login to CRM application</param> /// <param name="password">The Password to login to CRM application</param> /// <example>xrmBrowser.OnlineLogin.Login(_xrmUri, _username, _password);</example> public BrowserCommandResult <LoginResult> Login(Uri uri, SecureString username, SecureString password, SecureString mfaSecretKey = null, Action <LoginRedirectEventArgs> redirectAction = null) { //this.Login(uri, username, password, mfaSecretKey, default(Action<LoginRedirectEventArgs>)); return(_client.Execute(GetOptions("Login"), this.Login, uri, username, password, mfaSecretKey, default(Action <LoginRedirectEventArgs>))); }