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
What is an Iframe?
An Iframe is an HTML tag which stays inside an HTML document. Most of the time it seems like the element is present on a web page as usual but if element is under Iframe then we can not directly locate the element until we have switched to that Iframe. We can see how an Iframe looks like inside the HTML document.
So its clear that we need to first switch driver control to the Iframe and then further actions can be done as a normal web page.
Different ways to switch to an Iframe:
In order to switch to an Iframe we need to use “driver.switchTo.frame(%switchParameter%)”. Here frame() method takes an argument to switch to the Iframe in three different ways:
Let us see the sample code for each way to switch over an Iframe window:
WebElement ele= driver.findElement(By.xpath(xpathString));
Using Iframe WebElement:
driver.switchTo().frame(ele);
Using Iframe Index number:
driver.switchTo().frame(0);
Using Iframe name:
driver.switchTo().frame(“frameFirst”);
Using Iframe ID:
driver.switchTo().frame(“if1”);//String:Using frame ID
Once we have switched over an Iframe then we can perform normal Selenium actions like click(), getText(), sendKeys() and so many on the elements present inside that Iframe.
Switching to another Frame:
When we need to switch to any other Iframe while we are already dealing with one, first, we need to switch the control to the base page and then switch to another frame.
Let us say we are on FrameFirst and want to switch to FrameSecond, then first, we need to go back to the base page by using "driver.switchTo().defaultContent()” command.
Once we land to the base page, we can switch to FrameSecond as we have switched to FrameFirst.
driver.switchTo().defaultContent();
driver.switchTo().frame(“FrameSecond”);
This way the control gets switched to second frame and now we can perform normal WebElement actions on the elements present on Second frame.
Don't miss out!