GithubHelp home page GithubHelp logo

automacaosomar's Introduction

Configuração Automação - Selenium

Ferramentas

  • Visual Studio Enterprise (Instalar UnitTestAdaptor, Nunit e Selenium)
  • Chrome Driver (http://www.seleniumhq.org/download/)
  • Se necessário instalar "NUnit Test Adapter" Tools -> Extensions And Updates -> Online -> Search for "Nunit Test Adapter" -> Click on "NUnit Test Adapter" in results list -> Click on Download button

Principais assuntos

  • Assert
  • Atribuição de valores vindos da tela

Classes criadas

Classe Função
Tests Classe Mãe de todo o teste, herdando valores da WebDriver e executando as suites de testes
SeleniumUteis Classe responsável pelo patch do driver (Pode ser substituido por urls estáticas)
WebDriver Cria o Driver(recebe o patch, aqui ele pode ser estático), navega para URL e amplia a tela

Fluxo de Execução

  • Tests inicia chamando a herança da WebDriver
  • WebDriver cria o driver pegando o patch da SeleniumUteis
  • Abre o chrome e navega até a URL
  • Retorna para a Tests e as suites são executadas

Funções Abordadas

Assert

NUnit.Framework.Assert.AreEqual("VALOR",driver.FindElement(By.Id("CAMPO")).Text);

Atribuição de valores

// pega os dos valores na tela e guarda em uma variável
    string valor1 = driver.FindElement(By.Id("number1")).Text;
   string valor2 = driver.FindElement(By.Id("number2")).Text;

// transforma os resultados em um número inteiro para a soma
    int resultadoInt = Int32.Parse(valor1) + Int32.Parse(valor2);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.