Posts Tagged ‘Selenium’

Locating a WebElement for Selenium WebDriver With Firebug

Before an element can be found by WebDriver, we need to manually find the element using a Firefox Addon called Firebug 1. Open Firefox 2. Install the Firebug addon if its not already installed 3. Turn on Firebug addon 4. Click the mouse arrow in the Firebug panel 5. Click on an element on the…

Read More

Locating a WebElement With Selenium WebDriver

The following Selenium code in Java instructs the WebDriver to open the Firefox browser, go to the Mozilla Developer Network web page, find the WebElement “q” and perform a search for the query “html5.” The findElement method is very specific in that it only find one element using the By object. If zero elements are…

Read More

Using Selenium to Navigate to a URL

Below is a code sample instructing Selenium to navigate to a URL // A basic Selenium file to open a web page in Firefox package net.brav3.webdriver.A1; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; public class NavigateToAUrl { public static void main(String[] args) { WebDriver driver = new FirefoxDriver(); driver.get("https://developer.mozilla.org"); } } We create a WebDriver object for Firefox.…

Read More

Setting Up a Eclipse Project With Selenium

1. Open Eclipse 2. Click on File > New > Java Project > Enter a project name e.g. SeleniumProj 3. Click Next 4. Click on Libraries tab and click on Add External JARs 5. Add the JARs from the WebDriver client library folder and the JARs from the libs subdirectory. Click Finish 6. Right click…

Read More

How to Install Java and Selenium WebDriver

1. Install the latest version of Java JDK (at time of writing, latest is JDK8) 2. Install the latest version of Eclipse IDE for Java Developers (at time of writing, latest is Neon) 3. Install the latest version of Firefox 4. Install Firebug for Firefox: In Firefox > Tools > Add-ons > Search for “Firebug”…

Read More