TestNG skype application example
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import
org.openqa.selenium.firefox.FirefoxDriver;
import
org.testng.annotations.AfterClass;
import
org.testng.annotations.AfterMethod;
import
org.testng.annotations.BeforeClass;
import
org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class
ttttttttttttttttttttttttttttttttttt {
static WebDriver wd;
@BeforeClass
public void invoke()
{
wd = new FirefoxDriver();
}
@AfterClass
public void close()
{
wd.close();
}
@BeforeMethod
public void login() throws InterruptedException
{
wd.get("https://login.skype.com/login?message=signin_continue");
wd.findElement(By.xpath(".//*[@id='username']")).sendKeys("akhilreddy143");
wd.findElement(By.xpath(".//*[@id='password']")).sendKeys("akhilreddy143");
wd.findElement(By.xpath(".//*[@id='signIn']")).click();
Thread.sleep(5000l);
}
@AfterMethod
public void logout()
{
System.out.println("logout");
wd.findElement(By.xpath(".//*[@id='scom']/ul/li[14]/a")).click();
}
@Test
public void rates() throws InterruptedException
{
Thread.sleep(2000l);
wd.findElement(By.xpath(".//*[@id='username']")).clear();
Thread.sleep(3000l);
wd.findElement(By.xpath(".//*[@id='scom']/ul/li[8]/a")).click();
wd.findElement(By.xpath("html/body/section[1]/div/div/div[2]/div[1]/div/div[1]/div[2]/div/a/span")).click();
Thread.sleep(3000l);
wd.findElement(By.xpath(".//*[@id='scom']/ul/li[14]/a")).click();
}
@Test
public void help()
{
wd.findElement(By.xpath(".//*[@id='scom']/ul/li[9]/a")).click();
wd.findElement(By.xpath(".//*[@id='kbContent']/section[1]/div/div/span[2]/a")).click();
wd.findElement(By.xpath(".//*[@id='scom']/ul/li[14]/a")).click();
}}
No comments:
Post a Comment