public SuplementyService() { this.actions = new Stack <object>(); actions.Push(GetLogOutScript()); actions.Push(GetRedirectScript()); actions.Push(GetLoggingInScript()); actions.Push(GetRedirectToLoginPageScript()); //dictionary forbidden subsites for CheckForConditionOfBrowser method that checks the condition of flow in browser //dictionary determines which subsites are associated with operations ended due to error and which exception is assigned to each error this.forbiddenSubsites = new Dictionary <string, Exception>(); this.forbiddenSubsites.Add(errorLoginUrl, new InvalidCredentialsException(CredentialProvider.GetUsername(), CredentialProvider.GetPassword())); }
public object GetLoggingInScript() { CredentialProvider.stringBuilder.Clear(); CredentialProvider.stringBuilder.AppendLine("document.getElementById('user_login').value = '" + CredentialProvider.GetUsername() + "';"); CredentialProvider.stringBuilder.AppendLine("document.getElementById('user_pass').value='" + CredentialProvider.GetPassword() + "';"); CredentialProvider.stringBuilder.AppendLine("document.getElementsByClassName('btn signin_button')[0].click();"); var loggingInScript = CredentialProvider.stringBuilder.ToString(); return(loggingInScript); }
public object GetLoggingInScript() { CredentialProvider.stringBuilder.Clear(); CredentialProvider.stringBuilder.AppendLine("document.getElementsByClassName('button_button--sYDKO details_save--3nDG7')[0].click();"); CredentialProvider.stringBuilder.AppendLine("document.getElementById('auth').value='" + CredentialProvider.GetUsername() + "';"); CredentialProvider.stringBuilder.AppendLine("document.getElementById('password').value='" + CredentialProvider.GetPassword() + "';"); CredentialProvider.stringBuilder.AppendLine("document.getElementById('elSignIn_submit').click();"); var loggingInScript = CredentialProvider.stringBuilder.ToString(); return(loggingInScript); }