Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package grid;
- import java.net.MalformedURLException;
- import java.net.URL;
- import org.openqa.selenium.By;
- import org.openqa.selenium.WebDriver;
- import org.openqa.selenium.remote.DesiredCapabilities;
- import org.openqa.selenium.remote.RemoteWebDriver;
- import org.testng.annotations.AfterClass;
- import org.testng.annotations.BeforeClass;
- import org.testng.annotations.Test;
- public class Facebook {
- public WebDriver driver;
- @Test
- public void testFacebook() throws Exception {
- Thread.sleep(5000);
- driver.get("https://www.facebook.com");
- driver.findElement(By.id("email")).sendKeys("WebDriverEventListener");
- driver.findElement(By.id("pass")).sendKeys("Password");
- driver.findElement(By.id("u_0_b")).sendKeys("FirstName");
- driver.findElement(By.id("u_0_d")).sendKeys("LastName");
- driver.findElement(By.id("u_0_f")).sendKeys("1234567890");
- driver.findElement(By.id("u_0_i")).sendKeys("1234567890");
- driver.findElement(By.id("u_0_k")).sendKeys("password");
- Thread.sleep(5000);
- }
- @BeforeClass
- public void beforeClass() throws MalformedURLException{
- DesiredCapabilities capability= new DesiredCapabilities();
- capability.setBrowserName("firefox");
- driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"),capability);
- }
- @AfterClass
- public void afterClass() throws Exception {
- driver.quit();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement