public void SendMessage(string messageText)
 {
     MessageTextArea.Click();
     MessageTextArea.Clear();
     MessageTextArea.SendKeys(messageText);
     SendButton.Click();
 }
        /// <summary>
        /// Method, which find needed buttons ,and send message
        /// </summary>
        /// <param name="answerpsevdonim"></param>
        public void TextingAnswerMessageToMail(string answerpsevdonim)
        {
            Wait.Until(t => Driver.FindElements(By.XPath(Locator.AnswerButtonLocator)).Any());
            IncomingButton = Driver.FindElement(By.XPath(Locator.AnswerButtonLocator));
            IncomingButton.Click();

            Wait.Until(t => Driver.FindElements(By.XPath(Locator.TextBoxLocator)).Any());
            TextBoxLabel = Driver.FindElement(By.XPath(Locator.TextBoxLocator));
            TextBoxLabel.SendKeys(answerpsevdonim);

            Wait.Until(t => Driver.FindElements(By.XPath(Locator.SendButtonLocator)).Any());
            SendButton = Driver.FindElement(By.XPath(Locator.SendButtonLocator));
            SendButton.Click();
        }
Exemple #3
0
        /// <summary>
        /// Method allows to write and send message
        /// </summary>
        /// <param name="wheresend"></param>
        /// <param name="text"></param>
        public void WriteMessage(string wheresend, string text)
        {
            Wait.Until(t => Driver.FindElements(By.XPath(Locator.WritingMailButtonLocator)).Any());
            Writing = Driver.FindElement(By.XPath(Locator.WritingMailButtonLocator));
            Writing.Click();

            Wait.Until(t => Driver.FindElements(By.XPath(Locator.AdressToLocator)).Any());
            To = Driver.FindElement(By.XPath(Locator.AdressToLocator));
            To.SendKeys(wheresend);

            Wait.Until(t => Driver.FindElements(By.XPath(Locator.MessageBoxLocator)).Any());
            TextOfMessage = Driver.FindElement(By.XPath(Locator.MessageBoxLocator));
            TextOfMessage.Clear();
            TextOfMessage.SendKeys(text);

            Wait.Until(t => Driver.FindElements(By.XPath(Locator.SendButtonLocator)).Any());
            SendButton = Driver.FindElement(By.XPath(Locator.SendButtonLocator));
            SendButton.Click();
        }
Exemple #4
0
 public void ClickSendButton()
 {
     SendButton.Click();
 }
 public void EnterEmail(string email)
 {
     Email.SendKeys(email);
     SendButton.Click();
 }
Exemple #6
0
        protected void SendMessage(String Prefixo, String Nome, String DDD, String Telefone, String Mensagem) // Disparar envio
        {
            ImplicitWait();
            if (Telefone.Contains("-"))
            {
                Telefone = Telefone.Replace("-", String.Empty);
            }
            Nome     = Nome.Trim();
            Telefone = Telefone.Replace(" ", String.Empty);
            Telefone = DDD + Telefone;
            BaloonClick();

            if (IsElementPresent(By.XPath("/html/body/div[1]/div/div[5]/div/div/div/div/div[1]/header/a[2]/span/i")))
            {
                //"/html/body/div[1]/div/div[5]/div/div/div/div/div[1]/header/a[2]/span/i"));

                NamePT = Driver.FindElement(By.XPath("/html/body/div[1]/div/div[8]/div/div/div[2]/form/div[1]/div[1]/div/input"));
                NamePT.SendKeys(Nome);

                CellPhone = Driver.FindElement(By.XPath("/html/body/div[1]/div/div[8]/div/div/div[2]/form/div[1]/div[2]/div/input"));
                CellPhone.Click();
            }
            else
            {
                //Serviço Manual
                GoToManualService();

                Baloon = Driver.FindElement(By.XPath("/html/body/div[1]/div/div[5]/div/div/div/div/div[1]/header/a[2]/span/i"));
                Baloon.Click();
                //Thread.Sleep(4000);
                //Client = Driver.FindElement(By.XPath("/html/body/div[1]/div/div[8]/div/div/div[2]/form/div[1]/div[1]/div/input"));

                NamePT = Driver.FindElement(By.XPath("/html/body/div[1]/div/div[5]/div/div/div/div/div[1]/header/a[3]"));
                NamePT.SendKeys(Nome);

                //Thread.Sleep(4000);

                CellPhone = Driver.FindElement(By.XPath("/html/body/div[1]/div/div[8]/div/div/div[2]/form/div[1]/div[2]/div/input"));
                CellPhone.Click();
                //Thread.Sleep(3000);
            }
            for (int i = 0; i < Telefone.Length; i++)
            {
                CellPhone.SendKeys(Convert.ToString(Telefone[i]));
            }


            Message = Driver.FindElement(By.XPath("/html/body/div[1]/div/div[8]/div/div/div[2]/form/div[3]/div/div/textarea"));


            if (DateTime.Now.Hour >= 00 && DateTime.Now.Hour <= 11)
            {
                Message.SendKeys($"Bom dia, {Nome}, tudo bem? {Mensagem}");
            }
            else if (DateTime.Now.Hour >= 12 && DateTime.Now.Hour <= 17)
            {
                Message.SendKeys($"Boa tarde, {Nome}, tudo bem? {Mensagem}");
            }
            else if (DateTime.Now.Hour >= 18 && DateTime.Now.Hour <= 23)
            {
                Message.SendKeys($"Boa noite, {Nome}, tudo bem? {Mensagem}");
            }

            SendButton = Driver.FindElement(By.Id("btnSendMsg"));
            SendButton.Click();

            LastInfo = $"Nome: {Nome}\nTelefone: {Telefone}";
            UltimoTxt(Nome, Telefone);
            //Boolean IsOkayDisplayed = Driver.FindElement(By.XPath("/html/body/div[7]/div[2]/div/div/div/div/div/div/div/div[4]/button")).Displayed;
            //Thread.Sleep(7000);
            ///html/body/div[7]/div[2]/div/div/div/div/div/div/div Em atendimento
            while (IsElementPresent(By.XPath("/html/body/div[7]/div[2]/div/div/div/div/div")))
            {
                DialogTitle = Driver.FindElement(By.XPath("/html/body/div[7]/div[2]/div/div/div/div/div/div/div/div[3]/div/div"));
                if (DialogTitle.Text == "Aguarde, sua solicitação está sendo processada")
                {
                }
                else
                {
                    break;
                }
                System.Threading.Thread.Sleep(2000);
            }

            if (IsElementPresent(By.XPath("/html/body/div[7]/div[2]/div/div/div/div/div")))
            {
                ImplicitWait();
                DialogTitle = Driver.FindElement(By.XPath("/html/body/div[7]/div[2]/div/div/div/div/div/div/div/div[3]/div/div"));

                Relatorio(Prefixo, Nome, DDD, Telefone);
                //Pega o botão da janela de erro e clica.
                //GoToManualService();
                if (DialogTitle.Text == "Celular não encontrado")
                {
                    Driver.Navigate().GoToUrl(@"https://painel.zapsac.com/admin/atendimentos");
                    GoToManualService();
                }
                else if (DialogTitle.Text == "Esse cliente já está em atendimento pelo atendente: xxxx xxxx")
                {
                    Driver.Navigate().GoToUrl(@"https://painel.zapsac.com/admin/atendimentos");
                    CloseChat(Telefone);
                    Driver.Navigate().GoToUrl(@"https://painel.zapsac.com/admin/atendimentos");
                    GoToManualService();
                }
            }
            else if (IsElementPresent(By.XPath("/html/body/div[7]/div[2]/div/div/div/div/div/div/div/div[4]/button")) == false)
            {
                //Clica no botão de serviço manual novamente
                GoToManualService();
                CloseChat(Telefone);
                Driver.Navigate().GoToUrl(@"https://painel.zapsac.com/admin/atendimentos");
            }
        }
Exemple #7
0
        public void SendLetter()
        {
            SendButton.Click();

            IWebElement elem = ChekerSendLetter;
        }
 public NewMessagePage ClickSendButton()
 {
     SendButton.Click();
     return(this);
 }
Exemple #9
0
 public CreateExpensePage SendButtonClick()
 {
     SendButton.Click();
     return(this);
 }