Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.junit.After;
- import org.junit.Before;
- import org.junit.Test;
- import org.openqa.selenium.By;
- import org.openqa.selenium.WebDriver;
- import org.openqa.selenium.WebElement;
- import org.openqa.selenium.firefox.FirefoxDriver;
- public class SupertoysAutomationTest {
- private WebDriver firefoxdriver;
- @Before
- public void setUp(){
- firefoxdriver = new FirefoxDriver();
- }
- @Test
- public void Testing_Login_Form(){
- firefoxdriver.get("http://supertoys.bg/admin123");
- String validUserName = "test";
- String validPasswordField = "testtest123";
- WebElement userName = firefoxdriver.findElement(By.id("username"));
- WebElement password = firefoxdriver.findElement(By.id("login"));
- userName.clear();
- userName.sendKeys(validUserName);
- password.clear();
- password.sendKeys(validPasswordField);
- WebElement loginFormButton = firefoxdriver.findElement(By.xpath("/html/body/div/div/form/div/div[5]/input"));
- loginFormButton.click();
- WebElement logOutButton = firefoxdriver.findElement(By.className("link-logout"));
- logOutButton.click();
- }
- @Test
- public void Forgotten_Password_APS(){
- this.Testing_Login_Form();
- WebElement forgottenPasswordKey = firefoxdriver.findElement(By.xpath("/html/body/div/div/form/div/div[5]/a"));
- forgottenPasswordKey.click();
- WebElement actualPassword = firefoxdriver.findElement(By.id("email"));
- actualPassword.clear();
- actualPassword.sendKeys("qatester@abv.bg");
- WebElement submitEmailButton = firefoxdriver.findElement(By.xpath("/html/body/div/div/form/fieldset/div[4]/button"));
- submitEmailButton.click();
- }
- @Test
- public void New_Password_in_ABV_Post() {
- this.Forgotten_Password_APS();
- firefoxdriver.get("www.abv.bg");
- String validUserName = "qatester";
- String validPassword = "ceca12345";
- WebElement usernameFieldABV = firefoxdriver.findElement(By.id("username"));
- WebElement passwordFieldABV = firefoxdriver.findElement(By.id("password"));
- usernameFieldABV.clear();
- usernameFieldABV.sendKeys(validUserName);
- passwordFieldABV.clear();
- passwordFieldABV.sendKeys(validPassword);
- WebElement loginButtonFieldABV = firefoxdriver.findElement(By.id("loginBut"));
- loginButtonFieldABV.click();
- WebElement inboxKeyABV = firefoxdriver.findElement(By.xpath("/html/body/div[1]/div/div[4]/div/div[4]/div/div[2]/div/div[2]/div/div[4]/div/div[2]/div/div/div/table/tbody[1]/tr[1]/td/div/div"));
- inboxKeyABV.click();
- }
- @After
- public void EndTesting(){
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement