Java - Exemple de Test Selenium

pom.xml Maven

<project xmlns=""
		<!-- -->

Test JUnit

package fr.ronanlefichant.seleniumtest;

import static org.junit.jupiter.api.Assertions.assertTrue;

import java.time.Duration;

import org.junit.jupiter.api.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;

class SeleniumTest {

  void should_search() {
    // Les pilotes du navigateur
    System.setProperty("webdriver.gecko.driver", "geckodriver.exe");

    // Le pilote du navigateur (Firefox et Gecko ici)
    WebDriver driver = new FirefoxDriver();

    // Navigue vers la page

    // Cherche l'élément q et écrit "Java Selenium"
    driver.findElement("q")).sendKeys("Java Selenium");

    // Clique sur le bouton avec ID
    WebElement searchbutton = driver.findElement("search_button_homepage"));;

    // Attend 10 secondes
    WebDriverWait web = new WebDriverWait(driver, Duration.ofSeconds(10));

    try {
      // Vrai si dans les 10 secondes l'URL est ""
      boolean correctURL = web.until(ExpectedConditions.urlToBe(""));
    } finally {
      // Quitte




  1. CasinoIn was established in 2015 however it didn’t launch till 2019. The staff behind the casino needed to have the best product before it presented it to clients, they usually did an excellent job we have to admit. Now, CasinoIn offers a vibrant betting part that provides its players with every little thing they are in search of in an internet on line casino. Betwinner is a casino that was established again in 2018 in Russia. The second the casino was available 솔 카지노 on the market it was an immediate success.


Enregistrer un commentaire