示例#1
0
        public void pesquisarProduto()
        {
            //relatorio.startStep("Pesquisar Produto");
            CtrlChildActionLogin ctrlChildActionLogin = new CtrlChildActionLogin();

            ctrlChildActionLogin.SendKeys(By.CssSelector("#form-busca > input.sprocura"), "iPhone");
            ctrlChildActionLogin.Click(By.Id("bt-busca"));
            ctrlChildActionLogin.IsElementPresent(By.XPath("//*[@id='BlocoConteudo']/div/div/div[2]/section"));
            //relatorio.endStep("Pesquisa realizada com sucesso");
        }
        public void pesquisarOutrosProdutos()
        {
            //relatorio.startStep("Pesquisar Produto");
            CtrlChildActionLogin ctrlChildActionLogin = new CtrlChildActionLogin();

            Global.driver.Navigate().Back();
            ctrlChildActionLogin.SendKeys(By.CssSelector("#form-busca > input.sprocura"), "Televisão");
            ctrlChildActionLogin.Click(By.Id("bt-busca"));
            ctrlChildActionLogin.IsElementPresent(By.XPath("//*[@id='BlocoConteudo']/div/div/div[2]/section"));
            Thread.Sleep(1000);
            Print("PesquisarOutrosProdutos");
            Global.driver.Navigate().Back();
            ctrlChildActionLogin.SendKeys(By.CssSelector("#form-busca > input.sprocura"), "Computador");
            ctrlChildActionLogin.Click(By.Id("bt-busca"));
            ctrlChildActionLogin.IsElementPresent(By.XPath("//*[@id='BlocoConteudo']/div/div/div[2]/section"));
            Thread.Sleep(2000);
            Print("PesquisarOutrosProdutos1");

            //relatorio.endStep("Pesquisa realizada com sucesso");
        }
        public void Login(string login, string senha)
        { //Validar Seção de Login
            relatorio.startStep("Efetuar Login");

            //Efetuar Login
            CtrlChildActionLogin ctrlChildActionLogin = new CtrlChildActionLogin();

            ctrlChildActionLogin.Clear(By.Id("login_username"));
            ctrlChildActionLogin.SendKeys(By.Id("login_username"), login);
            ctrlChildActionLogin.Clear(By.Id("login_password"));
            ctrlChildActionLogin.SendKeys(By.Id("login_password"), senha);
            Thread.Sleep(2000);

            ctrlChildActionLogin.Click(By.XPath("//button[@type='submit']"));
            ctrlChildActionLogin.waitText(By.Id("text-login-msg"), "Login efetuado com sucesso!");
            ctrlChildActionLogin.assertAreEqual("Login efetuado com sucesso!", By.Id("text-login-msg"));


            relatorio.endStep("Login realizado com sucesso");
        }