i
WebDriver Introduction
Selenium WebDriver Architecture
Introduction to WebDriver API
Introduction to WebDriver – Code
Handling Dropdowns and Select class
Handling Multiple Dropdown values and Links
Handling Radio buttons and Checkboxes
Capture Screenshots and Email test results
Browser Navigation Methods
Handling tabs
Capturing screenshot, Handling tabs and pop-ups – Code
Handling tabs and Pop-ups – Code
Handling Alerts
Handling User Authentication and Input alerts
HtmlUnitDriver and Handling Captchas
Handling Web Tables
Synchronization
Handling WebTables, Synchronization issues, Firefoxprofiles – Code
Actions Class
Event Listeners, Event Firing Mouse, Coordinates – Code
Handling Mouse Hover in Selenium
JavascriptExecutor
Handling Iframes
IsElementPresent, IsEnabled, IsSelected
Working with Chrome Driver - Part 1
Working with FireFox Driver - Part 2
Working with Internet Explorer Driver - Part 3
Handling SSL Certificate
Desired Capabilities
How to Encode password in WebDriver
Handling JQuery Elements - Drag and Drop, Sliders, Resizable
Handling JQuery Elements - Drag and Drop, Sliders, Resizable – Code
Working on IE Browser using Actions
TestNG, Ant & Report Generation through XSLT
Introduction to TestNG and Annotations
TestNG Parameterization
Configuring ANT, Generating TestNG & XSLT Reports
Code for generating XSLT / Surefire Reports through MAVEN
TestNG Parameterization Excel Reading
Handling Multiple data providers
TestNG XSLT Jar, Build.xml & TestNG.xml file
Frameworks Introduction
Hybrid (DATA + KEYWORD) driven Framework
Framework Architecture
Reading Excel sheets
TestNG DataProvider
Data Provider with Hashtable
Handling Multiple Test Suites
Multiple DataProviders
Setting up Run-modes at Suite Level
Setting up Runmodes at TestCase Level
Creating a common utility for Run-modes
Hybrid Framework Code
We see situations in web pages where a new tab or a pop-up window gets opened, and the driver needs to control the new tab or window. In this situation, we must know the handle of a new tab/window to get control of the same.
First, we need to get the handle of the main window, and this helps to switch back to the main window once the operation on the second window is completed.
String mainWindowsHandle=driver.getWindowHandle();
We can open a new tab by using the below set of code and then check for total number of windows open.
driver.findElement(By.xpath("/html/body")).sendKeys(Keys.CONTROL+"t");
Let us now fetch the total number of the window handles to switch to other window.
Set allWindows=driver.getWindowHandles();
Now we need to iterate through the set of all window handles and need to switch to the tab which we opened.
Iterator itr=allWindows.iterator();
while(itr.hasNext())
{
String handle=itr.next();
if(!handle.equals(mainWindowsHandle))
{
driver.switchTo().window(handle);
driver.get("https://www.google.com/");
System.out.println(driver.getTitle());
}
}
This way we can switch to the newly opened tab and load an URL on the same. We can get the title of the page by using the getTitle() method to verify the web page.
Once we have performed the operations on the web page, we can switch back to the main window by using the main window/tab handle.
driver.switchTo().window(mainWindowsHandle);
Don't miss out!