https://www.gcreddy.com/2021/06/selenium-training-videos.html
Selenium Installation
Choose Plugins and frameworks for Selenium
Eclipse IDE - Editor - Writing & Executing Selenium Test cases, and Integrating Selenium with other software.
Java - Programming - Writing Selenium Test cases
Selenium WebDriver - Test Tool - Locating Elements in web pages and performing actions on the elements
Steps:
1. Downlad & Install Java (JDK) Software
2. Download and Install/extract Eclipse IDE
3. Set Java Environment variable path.
4. Download Selenium WebDriver jar file from selenium.dev web site, and add the jar file to the Java project in Eclipse IDE
5. Download Browser driver/s and instantiate the driver/s in the test cases
Navigation to Add 'Selenium WebDriver' jar file to Java Project in Eclipse IDE
Launch Eclipse IDE
Select Java project's 'src' folder and right-click
Select 'Build Path'
Select 'Configure Build Path'
Select the 'Libraries' tab
Click 'Add External jars' Button
Browser path of the Selenium WebDriver jar file
Apply & Close
Write first Selenium Test case & execute
Manual Test case: Verify Launch Application (Google search engine)
Test Steps:
1. Launch a Browser
2. Navigate to/Launch 'google.com'
3. Capture the page Title
Test Data: NA
Expected: 'Google'
Actual: * After Test Execution
Verification Point: Compare the captured page title with 'Google'
Test Result: * After Test Execution
Selenium Test Case using 'Chrome' driver
//Instantiate 'Chrome' browser driver
System.setProperty("webdriver.chrome.driver", "C:\\Users\\Hello\\Desktop\\chromedriver.exe");
WebDriver driver = new ChromeDriver();//Create chrome browser driver object in 'WebDriver' Interface (It launches the Chrome browser window with blank url)
driver.manage().window().maximize();//Maximizing the Browser window
driver.get("https://www.google.com/");//Launch the specified web page
String pageTitle= driver.getTitle();//Return the Page Title
if (pageTitle.equals("Google")) {
System.out.println("Google Application launched - Passed");
}
else {
System.out.println("Google Application Not launched - Failed");
}
driver.close();//Close the browser window
Selenium Test Case using 'Firefox' driver
//Instantiate 'Chrome' browser driver
System.setProperty("webdriver.gecko.driver", "C:\\Users\\Hello\\Desktop\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.manage().window().maximize();
driver.get("https://www.google.com/");
String pageTitle= driver.getTitle();
if (pageTitle.equals("Google")) {
System.out.println("Google Application launched - Passed");
}
else {
System.out.println("Google Application Not launched - Failed");
}
driver.close();
Selenium Test Case using 'Edge' driver
//Instantiate 'Chrome' browser driver
System.setProperty("webdriver.edge.driver", "C:\\Users\\Hello\\Desktop\\msedgedriver.exe");
WebDriver driver = new EdgeDriver();
driver.manage().window().maximize();
driver.get("https://www.google.com/");
String pageTitle= driver.getTitle();
if (pageTitle.equals("Google")) {
System.out.println("Google Application launched - Passed");
}
else {
System.out.println("Google Application Not launched - Failed");
}
driver.close();