Commit 59541a6f authored by Taha Rabbani's avatar Taha Rabbani

Add new file

parents
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.Select;
import java.util.concurrent.TimeUnit;
public class FormyAutomation {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver","C:\\Users\\trabbani\\IdeaProjects\\SeleniiumTask\\Driver\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("http://formy-project.herokuapp.com/form");
WebElement Firstname = driver.findElement(By.id("first-name"));
Firstname.sendKeys("Taha");
WebElement LastName = driver.findElement(By.cssSelector("input[id='last-name']"));
LastName.sendKeys("Rabbani");
WebElement JobTitle = driver.findElement(By.id("job-title"));
JobTitle.sendKeys("QA-Automation");
driver.findElement(By.xpath("//input[contains(@value,'radio-button-2')]"));
driver.findElement(By.xpath("//input[@value='checkbox-1']"));
Select experience = new Select(driver.findElement(By.xpath("//select[@id='select-menu']")));
experience.selectByIndex(1);
WebElement Date = driver.findElement(By.id("datepicker"));
Date.sendKeys("06/03/1996");
driver.findElement(By.xpath("//a[@role='button']")).click();
WebElement WebText1 = driver.findElement(By.xpath("(//div[contains(.,'The form was successfully submitted!')])[2]"));
System.out.println(WebText1.getText());
driver.quit();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment