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
Selenium runs on a variety of browsers, and Firefox is one of them. We will see how to run a test in the Firefox browser with the help of a Firefox driver.
Let us discuss the steps to follow for configuring the Firefox driver into our Selenium code:
Set the property for the driver path:
String driverPath="C:\\Users\\chromedriver.exe";
System.setProperty("webdriver.gecko.driver",driverPath);
Alternatively, we can set the driver path under “Environment Variables”, this way we can skip setting path from the code.
Select the Path variable section under System Variables and click on the Edit button. Now put a semicolon “;” at the end of the path variable’s string and enter the full path of the directory having Chrome Driver executable file.
Setting up the FirefoxOptions and DesiredCapablities and Instantiating the FirefoxDriver:
FirefoxOptions options=new FirefoxOptions();
options.setCapability("marionette", true);
DesiredCapabilities cap=new DesiredCapabilities();
cap.setCapability(FirefoxOptions.FIREFOX_OPTIONS, options);
WebDriver driver=new FirefoxDriver(cap);
Launching the URL in chrome browser:
Now we have instantiated the ChromeDriver object and its time to launch the URL in chrome browser.
driver.get("https://selflearning.io/");
Let us see the complete sample code to set up the chrome driver for running a Selenium script.
package SeleniumTest.SeleniumTest;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.remote.DesiredCapabilities;
public class FirefoxDriverTest
{
public static void main( String[] args )
{
String driverPath="C:\\Users\\geckodriver.exe";
System.setProperty("webdriver.gecko.driver",driverPath);
FirefoxOptions options=new FirefoxOptions();
options.setCapability("marionette", true);
DesiredCapabilities cap=new DesiredCapabilities();
cap.setCapability(FirefoxOptions.FIREFOX_OPTIONS, options);
WebDriver driver=new FirefoxDriver(cap);
driver.get("https://selflearning.io/");
}
}
Don't miss out!