Example #1
0
        public static void run(RecognitionEngine recogEngine, SpeechSynthesizer synthEngine, IWebDriver driver)
        {
            //recogEngine.UnSetAllGrammarFiles();
            //recogEngine.SetAnotherGrammarFile("CreditScore.txt");

reiterateIfStaticCommand:

            string command = recogEngine.GetRecognizedText(synthEngine);

            bool WhetherStaticCommand = StaticCommands.WhetherExecuted(driver, command);

            if (!WhetherStaticCommand)
            {
                Console.WriteLine(command);

                /*
                 * switch (command)
                 * {
                 *
                 *  default:
                 *      break;
                 * }
                 */
            }
            else
            {
                goto reiterateIfStaticCommand;
            }
        }
        public static void run(RecognitionEngine recogEngine, SpeechSynthesizer synthEngine, IWebDriver driver)
        {
            //synthEngine.Speak("are you a senior citizen");

reiterateIfStaticCommand:

            string command = recogEngine.GetRecognizedText(synthEngine);

            bool WhetherStaticCommand = StaticCommands.WhetherExecuted(driver, command);

            if (!WhetherStaticCommand)
            {
                switch (command)
                {
                case "yes":
                    driver.FindElement(By.ClassName("YesNo_iconMaleSeniorCitizenYes_1b5Xa")).Click();
                    FreeOffers.run(recogEngine, synthEngine, driver);
                    break;

                case "no":
                    driver.FindElement(By.ClassName("YesNo_iconMaleSeniorCitizenNo_AjA0z")).Click();
                    FreeOffers.run(recogEngine, synthEngine, driver);
                    break;

                default:
                    break;
                }
            }
            else
            {
                goto reiterateIfStaticCommand;
            }
        }
Example #3
0
        public static void run(RecognitionEngine recogEngine, SpeechSynthesizer synthEngine, IWebDriver driver)
        {
            //synthEngine.Speak("entering your details");

            string command = recogEngine.GetRecognizedText(synthEngine);

            StaticCommands.WhetherExecuted(driver, command);

            if (command == "enter details")
            {
                driver.FindElement(By.CssSelector("input[name=firstName]")).SendKeys("Aditya Singh");
                driver.FindElement(By.CssSelector("input[name=mobileNumber]")).SendKeys("7769987541");
                driver.FindElement(By.CssSelector("input[name=email]")).SendKeys("*****@*****.**");
                driver.FindElement(By.ClassName("btn-large")).Click();
            }

            string command2 = recogEngine.GetRecognizedText(synthEngine);

            StaticCommands.WhetherExecuted(driver, command2);
        }
        public static void run(RecognitionEngine recogEngine, SpeechSynthesizer synthEngine, IWebDriver driver)
        {
            string command = null;

            while (command != "terminate program")
            {
                command = recogEngine.GetRecognizedText(synthEngine);
                synthEngine.Speak("You have said " + command);
                Console.WriteLine(command);
            }
        }
Example #5
0
        public static void run(RecognitionEngine recogEngine, SpeechSynthesizer synthEngine, IWebDriver driver)
        {
            //synthEngine.Speak("which company do you work for");

reiterateIfStaticCommand:

            string command = recogEngine.GetRecognizedText(synthEngine);

            bool WhetherStaticCommand = StaticCommands.WhetherExecuted(driver, command);

            if (!WhetherStaticCommand)
            {
                switch (command)
                {
                case "microsoft":
                    driver.FindElement(By.ClassName("react-autosuggest__input")).SendKeys("microsoft");
                    driver.FindElement(By.ClassName("btn-large")).Click();
                    Salary.run(recogEngine, synthEngine, driver);
                    break;

                case "google":
                    driver.FindElement(By.ClassName("react-autosuggest__input")).SendKeys("google");
                    driver.FindElement(By.ClassName("btn-large")).Click();
                    Salary.run(recogEngine, synthEngine, driver);
                    break;

                case "facebook":
                    driver.FindElement(By.ClassName("react-autosuggest__input")).SendKeys("facebook");
                    driver.FindElement(By.ClassName("btn-large")).Click();
                    Salary.run(recogEngine, synthEngine, driver);
                    break;

                case "twitter":
                    driver.FindElement(By.ClassName("react-autosuggest__input")).SendKeys("twitter");
                    driver.FindElement(By.ClassName("btn-large")).Click();
                    Salary.run(recogEngine, synthEngine, driver);
                    break;

                default:
                    break;
                }
            }
            else
            {
                goto reiterateIfStaticCommand;
            }
        }
Example #6
0
        public static void Main(string[] args)
        {
            // Initialize RecognitionEngine
            RecognitionEngine recogEngine = new RecognitionEngine();

            recogEngine.SetupRecognitionEngine();
            recogEngine.SetGrammarFile("Numbers.txt");

            // Initialize SpeechSynthesizer
            SpeechSynthesizer synthEngine = new SpeechSynthesizer();

            synthEngine.SetOutputToDefaultAudioDevice();

            string command = recogEngine.GetRecognizedText(synthEngine);

            Console.WriteLine(command);
        }
Example #7
0
        public static void run(RecognitionEngine recogEngine, SpeechSynthesizer synthEngine, IWebDriver driver)
        {
            //synthEngine.Speak("where do you live");

reiterateIfStaticCommand:

            string command = recogEngine.GetRecognizedText(synthEngine);

            bool WhetherStaticCommand = StaticCommands.WhetherExecuted(driver, command);

            if (!WhetherStaticCommand)
            {
                switch (command)
                {
                case "banglore":
                    driver.FindElement(By.ClassName("ResidentCity_iconBangalore_21hQE")).Click();
                    CompanyName.run(recogEngine, synthEngine, driver);
                    break;

                case "chennai":
                    driver.FindElement(By.ClassName("ResidentCity_iconChennai_SfqFL")).Click();
                    CompanyName.run(recogEngine, synthEngine, driver);
                    break;

                case "mumbai":
                    driver.FindElement(By.ClassName("ResidentCity_iconMumbai_3i73_")).Click();
                    CompanyName.run(recogEngine, synthEngine, driver);
                    break;

                case "new delhi":
                    driver.FindElement(By.ClassName("ResidentCity_iconNewDelhi_2IARH")).Click();
                    CompanyName.run(recogEngine, synthEngine, driver);
                    break;

                default:
                    break;
                }
            }
            else
            {
                goto reiterateIfStaticCommand;
            }
        }
Example #8
0
        public static void run(RecognitionEngine recogEngine, SpeechSynthesizer synthEngine, IWebDriver driver)
        {
reiterateIfStaticCommand:

            string command = recogEngine.GetRecognizedText(synthEngine);

            bool WhetherStaticCommand = StaticCommands.WhetherExecuted(driver, command);

            if (!WhetherStaticCommand)
            {
                switch (command)
                {
                default:
                    break;
                }
            }
            else
            {
                goto reiterateIfStaticCommand;
            }
        }
Example #9
0
        public static void run(RecognitionEngine recogEngine, SpeechSynthesizer synthEngine, IWebDriver driver)
        {
            //synthEngine.Speak("what is you net monthly salary, enter one digit at a time");

reiterateIfStaticCommand:

            //synthEngine.Speak("If done speak click continue");

            string command = recogEngine.GetRecognizedText(synthEngine);

            bool WhetherStaticCommand = StaticCommands.WhetherExecuted(driver, command);

            if (!WhetherStaticCommand)
            {
                switch (command)
                {
                case "number one":
                    driver.FindElement(By.CssSelector("input[name='netMonthlyIncome']")).SendKeys("1");
                    goto reiterateIfStaticCommand;

                case "number two":
                    driver.FindElement(By.CssSelector("input[name='netMonthlyIncome']")).SendKeys("2");
                    goto reiterateIfStaticCommand;

                case "number three":
                    driver.FindElement(By.CssSelector("input[name='netMonthlyIncome']")).SendKeys("3");
                    goto reiterateIfStaticCommand;

                case "number four":
                    driver.FindElement(By.CssSelector("input[name='netMonthlyIncome']")).SendKeys("4");
                    goto reiterateIfStaticCommand;

                case "number five":
                    driver.FindElement(By.CssSelector("input[name='netMonthlyIncome']")).SendKeys("5");
                    goto reiterateIfStaticCommand;

                case "number six":
                    driver.FindElement(By.CssSelector("input[name='netMonthlyIncome']")).SendKeys("6");
                    goto reiterateIfStaticCommand;

                case "number seven":
                    driver.FindElement(By.CssSelector("input[name='netMonthlyIncome']")).SendKeys("7");
                    goto reiterateIfStaticCommand;

                case "number eight":
                    driver.FindElement(By.CssSelector("input[name='netMonthlyIncome']")).SendKeys("8");
                    goto reiterateIfStaticCommand;

                case "numberoo nine":
                    driver.FindElement(By.CssSelector("input[name='netMonthlyIncome']")).SendKeys("9");
                    goto reiterateIfStaticCommand;

                case "click continue":
                    driver.FindElement(By.ClassName("btn-large")).Click();
                    Gender.run(recogEngine, synthEngine, driver);
                    break;

                default:
                    break;
                }
            }
            else
            {
                goto reiterateIfStaticCommand;
            }
        }
Example #10
0
        public static void run(RecognitionEngine recogEngine, SpeechSynthesizer synthEngine, IWebDriver driver)
        {
            recogEngine.SetGrammarFile("HomePage.txt");

            driver.Url = "https://www.bankbazaar.com/";

            /*
             * synthEngine.SpeakAsync("choose from credit score, home loan, car loan" +
             *  "used car loan, personal loan, short term loan, credit card, debit card" +
             *  "mutual fund, life insurance, car insurance, two wheeler insurance" +
             *  "health insurance, savings account, fixed deposit");
             */

reiterateIfStaticCommand:

            string command = recogEngine.GetRecognizedText(synthEngine);

            bool WhetherStaticCommand = StaticCommands.WhetherExecuted(driver, command);

            if (!WhetherStaticCommand)
            {
                switch (command)
                {
                case "credit score":
                    driver.FindElement(By.ClassName("bbicons-cs")).Click();
                    CreditScore.CreditScore.run(recogEngine, synthEngine, driver);
                    break;

                case "home loan":
                    driver.FindElement(By.ClassName("bbicons-hl")).Click();
                    HomeLoan.HomeLoan.run(recogEngine, synthEngine, driver);
                    break;

                case "car loan":
                    driver.FindElement(By.ClassName("bbicons-cl")).Click();
                    CarLoan.CarLoan.run(recogEngine, synthEngine, driver);
                    break;

                case "used car loan":
                    driver.FindElement(By.ClassName("bbicons-ucl")).Click();
                    UsedCarLoan.UsedCarLoan.run(recogEngine, synthEngine, driver);
                    break;

                case "personal loan":
                    driver.FindElement(By.ClassName("bbicons-pl")).Click();
                    PersonalLoan.PersonalLoan.run(recogEngine, synthEngine, driver);
                    break;

                case "short term loan":
                    driver.FindElement(By.ClassName("bbicons-stpl")).Click();
                    ShortTermLoan.ShortTermLoan.run(recogEngine, synthEngine, driver);
                    break;

                case "credit card":
                    driver.FindElement(By.ClassName("bbicons-cc")).Click();
                    CreditCard.CreditCard.run(recogEngine, synthEngine, driver);
                    break;

                case "debit card":
                    driver.FindElement(By.ClassName("bbicons-dc")).Click();
                    DebitCard.DebitCard.run(recogEngine, synthEngine, driver);
                    break;

                case "mutual fund":
                    driver.FindElement(By.ClassName("bbicons-mf")).Click();
                    MutualFund.MutualFund.run(recogEngine, synthEngine, driver);
                    break;

                case "life insurance":
                    driver.FindElement(By.ClassName("bbicons-lfi")).Click();
                    LifeInsurance.LifeInsurance.run(recogEngine, synthEngine, driver);
                    break;

                case "car insurance":
                    driver.FindElement(By.ClassName("bbicons-ci")).Click();
                    CarInsurance.CarInsurance.run(recogEngine, synthEngine, driver);
                    break;

                case "two wheeler insurance":
                    driver.FindElement(By.ClassName("bbicons-twi")).Click();
                    TwoWheelerInsurance.TwoWheelerInsurance.run(recogEngine, synthEngine, driver);
                    break;

                case "health insurance":
                    driver.FindElement(By.ClassName("bbicons-hi")).Click();
                    HealthInsurance.HealthInsurance.run(recogEngine, synthEngine, driver);
                    break;

                case "savings account":
                    driver.FindElement(By.ClassName("bbicons-acc")).Click();
                    SavingsAccount.SavingsAccount.run(recogEngine, synthEngine, driver);
                    break;

                case "fixed deposit":
                    driver.FindElement(By.ClassName("bbicons-fd")).Click();
                    FixedDeposit.FixedDeposit.run(recogEngine, synthEngine, driver);
                    break;

                default:
                    break;
                }
            }
            else
            {
                goto reiterateIfStaticCommand;
            }
        }