Facebook registration code
solution:=-------
package Webdriverprgs;
import org.apache.bcel.generic.Select;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.server.handler.FindElement;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.AfterTest;
public class fbregistration {
public WebDriver driver;
@Test
public void f() {
driver.findElement(By.xpath("//*[@value='First Name']")).sendKeys("sari");
driver.findElement(By.xpath("//*[@value='Last Name']")).sendKeys("chary");
driver.findElement(By.id("u_0_5")).sendKeys("sari@mail.com");
driver.findElement(By.id("u_0_8")).sendKeys("sari@mail.com");
driver.findElement(By.id("u_0_a")).sendKeys("abc12345");
new org.openqa.selenium.support.ui.Select(driver.findElement(By.xpath("//*[@name='birthday_day']"))).selectByVisibleText("3");
new org.openqa.selenium.support.ui.Select(driver.findElement(By.xpath("//*[@id='month']"))).selectByValue("11");
new org.openqa.selenium.support.ui.Select(driver.findElement(By.xpath("//*[@id='year']"))).selectByValue("1987");
driver.findElement(By.xpath("//*[@id='u_0_g']/span[1]/label")).click();
driver.findElement(By.xpath("//*[@id='u_0_i']")).click();
}
@BeforeTest
public void beforeTest() {
driver = new FirefoxDriver();
driver.get("https://www.facebook.com/");
driver.manage().window().maximize();
}
@AfterTest
public void afterTest() {
}
}
solution:=-------
package Webdriverprgs;
import org.apache.bcel.generic.Select;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.server.handler.FindElement;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.AfterTest;
public class fbregistration {
public WebDriver driver;
@Test
public void f() {
driver.findElement(By.xpath("//*[@value='First Name']")).sendKeys("sari");
driver.findElement(By.xpath("//*[@value='Last Name']")).sendKeys("chary");
driver.findElement(By.id("u_0_5")).sendKeys("sari@mail.com");
driver.findElement(By.id("u_0_8")).sendKeys("sari@mail.com");
driver.findElement(By.id("u_0_a")).sendKeys("abc12345");
new org.openqa.selenium.support.ui.Select(driver.findElement(By.xpath("//*[@name='birthday_day']"))).selectByVisibleText("3");
new org.openqa.selenium.support.ui.Select(driver.findElement(By.xpath("//*[@id='month']"))).selectByValue("11");
new org.openqa.selenium.support.ui.Select(driver.findElement(By.xpath("//*[@id='year']"))).selectByValue("1987");
driver.findElement(By.xpath("//*[@id='u_0_g']/span[1]/label")).click();
driver.findElement(By.xpath("//*[@id='u_0_i']")).click();
}
@BeforeTest
public void beforeTest() {
driver = new FirefoxDriver();
driver.get("https://www.facebook.com/");
driver.manage().window().maximize();
}
@AfterTest
public void afterTest() {
}
}
tuzla arçelik klima servisi
ReplyDeletemaltepe arçelik klima servisi
üsküdar vestel klima servisi
beykoz bosch klima servisi
ataşehir daikin klima servisi
tuzla vestel klima servisi
ataşehir mitsubishi klima servisi
maltepe vestel klima servisi
kadıköy vestel klima servisi