Exemplo n.º 1
0
        private bool DoFourthStep()
        {
            var l = new List <bool> {
                this.WebDriver.InvokeMemberClick($"#{GetDocumentTypeId(this.UserData.DocumentType)}"),
                this.WebDriver.UpdateFieldData("#txtIdCitado", this.UserData.DocumentNumber),
                this.WebDriver.UpdateFieldData("#txtDesCitado", this.UserData.CustomerNameAndSurname),
                this.WebDriver.SelectElementInList("#txtPaisNac", this.UserData.Country)
            };

            if (!this.UserData.TieExpiredDate.Equals(DateTime.MinValue))
            {
                l.Add(this.WebDriver.UpdateFieldData("#txtFecha",
                                                     this.UserData.TieExpiredDate.ToShortDateString().Replace(".", "/")));
            }

            if (!l.All(el => el.Equals(true)))
            {
                return(false);
            }
            this._logger.Info("OK! Second step solved successfully!");
            this._logger.Info("Sending captcha to solving...");
            this._currentTask = this.CaptchaResolver.SendTaskToResolve();

            return(true);
        }
 private bool DoFourthStep()
 {
     if (this.UserData.ProcedureName.Equals(MallorcaProcedure))
     {
         if (this.WebDriver.InvokeMemberClick($"#{GetDocumentTypeId(this.UserData.DocumentType)}") &&
             this.WebDriver.UpdateFieldData("#txtIdCitado", this.UserData.DocumentNumber) &&
             this.WebDriver.UpdateFieldData("#txtDesCitado", this.UserData.CustomerNameAndSurname) &&
             this.WebDriver.UpdateFieldData("#txtAnnoCitado", this.UserData.CustomerDateOfBirth.Year.ToString()))
         {
             this._logger.Info("OK! Second step solved successfully!");
             this._logger.Info("Sending captcha to solving...");
             this._currentTask = this.CaptchaResolver.SendTaskToResolve();
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         if (this.UserData.TieExpiredDate.ToShortDateString() != "01.01.0001")
         {
             if (this.WebDriver.InvokeMemberClick($"#{GetDocumentTypeId(this.UserData.DocumentType)}") &&
                 this.WebDriver.UpdateFieldData("#txtIdCitado", this.UserData.DocumentNumber) &&
                 this.WebDriver.UpdateFieldData("#txtDesCitado", this.UserData.CustomerNameAndSurname) &&
                 this.WebDriver.UpdateFieldData("#txtFecha", this.UserData.TieExpiredDate.ToShortDateString().Replace(".", "/")) &&
                 this.WebDriver.SelectElementInList("#txtPaisNac", this.UserData.Country))
             {
                 this._logger.Info("OK! Second step solved successfully!");
                 this._logger.Info("Sending captcha to solving...");
                 this._currentTask = this.CaptchaResolver.SendTaskToResolve();
                 return(true);
             }
             else
             {
                 return(false);
             }
         }
         else
         {
             if (this.WebDriver.InvokeMemberClick($"#{GetDocumentTypeId(this.UserData.DocumentType)}") &&
                 this.WebDriver.UpdateFieldData("#txtIdCitado", this.UserData.DocumentNumber) &&
                 this.WebDriver.UpdateFieldData("#txtDesCitado", this.UserData.CustomerNameAndSurname) &&
                 this.WebDriver.SelectElementInList("#txtPaisNac", this.UserData.Country))
             {
                 this._logger.Info("OK! Second step solved successfully!");
                 this._logger.Info("Sending captcha to solving...");
                 this._currentTask = this.CaptchaResolver.SendTaskToResolve();
                 return(true);
             }
             else
             {
                 return(false);
             }
         }
     }
 }
Exemplo n.º 3
0
        private void InvokeOnStepsControllerCaptchaCallback(IRecaptchaV2ResolverTask task)
        {
            if (ReferenceEquals(OnStepsControllerCaptchaCallback, null))
            {
                return;
            }

            this.OnStepsControllerCaptchaCallback(this, new StepsControllerCaptchaCallbackEventArgs(task));
        }
        private bool SolveFields()
        {
            if (this.WebDriver.UpdateFieldData("#txtnie", UserData.NIENumber) &&
                this.WebDriver.UpdateFieldData("#txtFecha", UserData.DateRequest.ToShortDateString().Replace(".", "/")) &&
                this.WebDriver.UpdateFieldData("#txtAnnoNac", UserData.CustomerDateBirth.Year.ToString()))
            {
                this._logger.Info("OK! Second step solved successfully!");
                this._logger.Info("Sending captcha to solving...");
                this._currentTask = this.CaptchaResolver.SendTaskToResolve();

                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 5
0
 private bool DoFourthStep()
 {
     if (this.webDriver.InvokeMemberClick($"#{GetDocumentTypeId(this.UserData.DocumentType)}") &&
         this.webDriver.UpdateFieldData("#txtIdCitado", this.UserData.DocumentNumber) &&
         this.webDriver.UpdateFieldData("#txtDesCitado", this.UserData.CustomerNameAndSurname) &&
         this.webDriver.UpdateFieldData("#txtAnnoCitado", this.UserData.CustomerDateOfBirth.Year.ToString()) &&
         this.webDriver.SelectElementInList("#txtPaisNac", this.UserData.Country))
     {
         this.Logger.Info("OK! Second step solved successfully!");
         this.Logger.Info("Sending captcha to solving...");
         this._currentTask = this.recaptcharResolver.SendTaskToResolve();
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 6
0
 public StepsControllerCaptchaCallbackEventArgs(IRecaptchaV2ResolverTask task)
 {
     RucaptchaResponse = task;
 }
Exemplo n.º 7
0
 public RecaptchaV2TaskResultEventArgs(IRecaptchaV2ResolverTask task)
 {
     Task = task;
 }