QA

Comenzando a automatizar usando Selenium y Cucumber

Published by
Jesidey Rincón
Comenzando a automatizar usando Selenium y Cucumber
Written by
Jesidey Rincón
Published in
March 5, 2024
Reading time
Category
QA

Conceptos básicos:

Selenium: Es un framework de automatización de pruebas para entorno web y aplicaciones mobile. Cucumber: Es un framework que permite el desarrollo BDD (Behaviour Driven Depelopment), permitiendo escribir tests en lenguaje Gherkins Para aprender más de Cucumber click en el siguiente link —> https://cucumber.io/docs/guides/ Gherkins: Lenguaje de alto nivel que permite la escritura de tests basados en escenarios, los archivos Gherkins tendrán extensión .feature Para aprender más acerca de Gherkins click en el siguiente link —> https://cucumber.io/docs/gherkin/

Herramientas a instalar localmente en la máquina donde se correrán los tests:

Nota: Es preferible que todo se instale a través de instalador de paquetes de línea de comando, para que las variables de entorno sean configuradas en el momento en que se instalan los paquetes. Para Windows existe Chocolatey y para Mac homebrew

Para configurar el webdriver de IE es necesario pasarle como parámetros de configuración el directorio donde se encuentra el .exe, quedando de la siguiente manera:


System.setProperty("webdriver.ie.driver","c:\\Users\\jrinc\\Desktop\\IEDriverServer.exe");

También se debe habilitar el Modo Protegido para el navegador. Esto se hace abriendo internet explorer, botón de configuración, luego ir a opciones de internet, luego Seguridad y habilitar modo protegido para Internet, Intranet Local, Sitios de Confianza y Sitios Restringidos

Dependencias Maven utilizar:

  • junit
  • cucumber-java
  • cucumber-junit
  • selenium-java
  • maven-compiler-plugin

Herramientas de trabajo:

Algún IDE de tu preferencia (también se puede usar vim)

Ahora sí, comencemos, y esto se hace generando un proyecto Maven desde 0 a través del IDE.

El archivo pom.xml debe quedar de la siguiente manera:

attach icon
Attach file
maximum: 10MB
Thank you. We have received your shipment.
Oops! Something went wrong while submitting the form.

Download it for FREE here! 🇺🇸

Enter your details in the following form and get the full report.
attach icon
Adjuntar archivo
máximo: 10MB
Download the file by clicking the button
Click here
Oops! Something went wrong while submitting the form.

Create your own AI agents with Pulzen LLMApp

Es
Eng