package zacksolutions;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

import java.io.ByteArrayOutputStream;

public class GuestBookWebPage {
    public static String title;
    public static void main( String[] args ) {
    }
    public static void getTitle() throws InterruptedException {
        //System.setProperty("web-driver.gecko.driver","/home/ilyes/mvnAction/SeleniumIntro/drivers/chromedriver");
        System.setProperty("web-driver.gecko.driver","/home/ilyes/mvnAction/SeleniumIntro/drivers/geckodriver");
        WebDriver driver = new FirefoxDriver();
        //WebDriver driver = new ChromeDriver();
        driver.get("https://zenful.cloud/");
        title = driver.getTitle();
        driver.findElement(By.id("message")).sendKeys("4 8 15 16 23 42");
        driver.findElement(By.xpath("//button[normalize-space()='Add message']")).click();
        Thread.sleep(3000);
        driver.close();
    }
}
