How to read text from PDF file using Java and Selenium Webdriver
How to open a link in a new tab or window and switch to it with Selenium WebDriver
Sometimes we need to verify a PDF content but Selenium WebDriver doesn’t have any direct methods to do that. If we want to extract the PDF content then we can use for example Apache PDFBox. Simply download the .jar files and add them to your Eclipse Class path. Here is a sample script which will […]
How to count number of images available on a web page then download them using selenium webdriver?
The following codes are works both in Firefox and Chrome browsers. Open a link in a new window and switch to it:
VisGrid – a GUI for Selenium Grid
The simplest way to gather the images from a website is to find them by tagName. First we create a WebElement list with the elements which tagName is ”img”. Then we check the elements to be sure that they are displayed. If they are displayed then we get their names and sources. To download them […]
How to install and setup Jenkins
VisGrid is a very useful GUI tool to start/stop the Selenium hub and to add/remove nodes to it. First step to download the program from http://www.codoid.com/products/view/2/30 and to extract wherever you want. We can start to program with the ‘VisGrid.jar’ file.
Reading test data from a CSV file using JUnit
We use Ubuntu system as a base for this tutorial. Before we want to install Jenkins we need to install Java JDK. Ubuntu is using Openjdk, to install it type the following to terminal: $sudo apt-get install openjdk-7-jdk Ubuntu installs the JDK (in my case)to the /usr/lib/jvm/java-7-openjdk-amd64/ folder. In additional, Ubuntu also puts the JDK […]
Creating a data-driven test with JUnit
It is recommended that we store the test data separately from the test scripts. This data can be exported in CSV format. We can read CSV files using Java IO and utility classes. In this blog, we will read data from a CSV file and use this data to execute the test script.
Recording videos of tests in Java
We can create data-driven Selenium WebDriver tests using the JUnit parameterization feature. This can be done by using the JUnit parameterized class runner. In this blog, we will create a simple JUnit test case to test Facebook registration. We will specify the test data within our JUnit test case class. We will use various JUnit […]
How to use Windows registry value from Selenium WebDriver
In Java, we can extend Selenium WebDriver test scripts to record videos by using an open source tool named Monte Media Library. In this blog we will look at how to configure and use the Monte Media Library’s ScreenRecorder class with Selenium, to record movies of tests. ScreenRecoder supports the AVI and QuickTime formats for […]
How to connect multiple machines to the Selenium Grid hub
The WindowsUtils class provides various methods to interact with the registry on the Windows operating system. While running tests on the Windows operating system and Internet Explorer, the test might need to read and modify IE settings or there may be a need to get some settings related to the web server or database from […]
There might an instance in which we would want to run, for example, 50 tests in parallel. 50 browsers would consume the CPU power very fast, so we need to split the load between multiple machines. Fortunately with Selenium Grid 2 this is not a problem.