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
Drag and Drop:
Let us see the sample codes for Drag and Drop of a JQuery element below:
package SeleniumTest.SeleniumTest;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.remote.DesiredCapabilities;
public class DragAndDrop
{
public static void main( String[] args )
{
System.setProperty("webdriver.chrome.driver",driverPath);
ChromeOptions options=new ChromeOptions();
options.addArguments("start-maximized");
DesiredCapabilities dc=new DesiredCapabilities();
dc.setCapability(ChromeOptions.CAPABILITY, options);
WebDriver driver=new ChromeDriver(dc);
driver.get("https://selflearning.io/");
// Find the locator for the drag element
WebElement ele1=driver.findElement(By.id("drag"));
// Find the locator for the drop element
WebElement ele2=driver.findElement(By.id("drop"));
//Instantiate the Actions class to build the actions of drag and drop.
Actions action=new Actions(driver);
action.dragAndDrop(ele1, ele2).build().perform();
}
}
Handling Slider operation Code:
package SeleniumTest.SeleniumTest;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.remote.DesiredCapabilities;
public class SliderSelenium
{
public static void main( String[] args )
{
System.setProperty("webdriver.chrome.driver",driverPath);
ChromeOptions options=new ChromeOptions();
options.addArguments("start-maximized");
DesiredCapabilities dc=new DesiredCapabilities();
dc.setCapability(ChromeOptions.CAPABILITY, options);
WebDriver driver=new ChromeDriver(dc);
driver.get("https://www.syncfusion.com/javascript-ui-controls/js-range-slider");
// Switch to the iframe where slider element is located
driver.switchTo().frame(driver.findElement(By.xpath("//*[@id='control-content']/div[1]/iframe")));
//Get the locator for the Slider element
WebElement sliderElement=driver.findElement(By.xpath("//*[@id='default']/div[2]"));
// Get the locator for the target range element
WebElement targetElement=driver.findElement(By.xpath("//*[@id='default']/ul/li[21]/span"));
// Instantiate the Actions class to build the action
Actions action=new Actions(driver);
// Build the actions of sliding the element
action.moveToElement(sliderElement).dragAndDrop(sliderElement,targetElement).build().perform();
}
}
Handling the JQuery Resizable element
package SeleniumTest.SeleniumTest;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.remote.DesiredCapabilities;
public class ResizableElement
{
public static void main( String[] args ) throws InterruptedException
{
System.setProperty("webdriver.chrome.driver",driverPath);
ChromeOptions options=new ChromeOptions();
options.addArguments("start-maximized");
DesiredCapabilities dc=new DesiredCapabilities();
dc.setCapability(ChromeOptions.CAPABILITY, options);
WebDriver driver=new ChromeDriver(dc);
driver.get("https://selflearning.io/");
// This is the locator of corner of the resizable element
WebElement resizableElement=driver.findElement(By.xpath("//*[@id='default']/div[2]"));
// Instantiate the Actions class to build all the actions.
Actions action=new Actions(driver);
action.dragAndDropBy(resizableElement,250,250).build().perform();
//Again we can resize th element by alternate method
action.clickAndHold(resizableElement).moveByOffset(-90, -90).build().perform();
}
}
Don't miss out!