DATA SCIENCES AND MACHINE LEARNING TRAINNG STARTS ON 15-MAY-2021 ******************** NEW QA JOB PLACEMENT PROGRAM - STARTS ON 15-MAY-2021 ******************** DEVOPS+AWS TRAINING AND JOB PLACEMENT PROGRAM - STARTS IN JUN-2021 ******************** BUSINESS ANALYST JOB PLACEMENT PROGRAM - STARTS ON 15-MAY-2021

Sample Selenium Project Guru99 – Day 2 Code


import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;

import junit.framework.Assert;

public class projectlogin {

	@Test
	public static void logintest() {

		// Step 0.1: Invoke the browser
		System.setProperty("webdriver.chrome.driver", "src//main//resources//chromedriver.exe");
		WebDriver bank = new ChromeDriver();
		
		login(bank);
		DayTwo(bank);
	}

	private static void login(WebDriver bank) {

		// Step 1: Open the Website
		String url = "http://www.demo.guru99.com/V4/";
		bank.get(url);
		
		//Maximize Window
		bank.manage().window().maximize();

		// Step 1: Enter the username
		// mngr288729
		WebElement username = bank.findElement(By.xpath("//input[@name='uid']"));
		username.sendKeys("mngr288729");

		// Step 2:Enter the password
		// upapAtE
		WebElement password = bank.findElement(By.xpath("//input[@name='password']"));
		password.sendKeys("upapAtE");

		// Step 2: Click on Login Button
		WebElement button = bank.findElement(By.xpath("//input[@type='submit']"));
		button.click();

	}

	public static void DayTwo(WebDriver bank) {

		// validate the Landing Page

		String expected_landing = "http://www.demo.guru99.com/V4/manager/Managerhomepage.php";
		String actual_landing = bank.getCurrentUrl();
		Assert.assertEquals(expected_landing, actual_landing, "The landing page is not correct");
		System.out.println("The expected Page is correct");
		
		//Close Window
		bank.close();

	}

}


Refer to the details of our Job Placement Program at:

Software QA Testing


Resolve6 Software QA Training and Job Placement Program with Selenium, JMeter, SOAPUI
Canada, Brampton, Mississauga, Toronto