selenium program based on testng priority

Test Automation 0 Comment 66

package kolli;

import org.junit.Assert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.Test;

public class Seltng2 {
WebDriver obj= new FirefoxDriver();
@Test(priority=1)
public void seltng()
{

obj.get(“http://www.gmail.com”);
String pageTitle = obj.getTitle();
Assert.assertEquals(pageTitle,”Gmail”);

}
@Test(priority =2)
public void seltng1()
{

obj.findElement(By.name(“Email”)).sendKeys(“********@gmail.com”);
obj.findElement(By.id(“next”)).click();
}
@Test(priority=3)
public void seltng2() throws InterruptedException
{
Thread.sleep(5000);
obj.findElement(By.name(“Passwd”)).sendKeys(“*********.”);
Thread.sleep(5000);
}
@Test(priority=4)
public void seltng3()
{
obj.findElement(By.id(“signIn”)).click();
}
}

Author

Related Articles

Leave a comment

You must be logged in to post a comment.

© 2016 4frienz. Powered By Flowers

Back to Top