Interview Questions & Answers Selenium Webdriver Tutorials

How to read data from a Web Table using Selenium

Tables are one of the primary design tools for HTML documents. Tables allow for greater control over page layout, allowing creation of more visually interesting pages. Table has rows and columns to store the data. I guess 50% IT industry will come to a halt if Microsoft Excel stops working 😉 that’s the importance of tables in organizing data. Search results on many websites are often displayed in the form of table. E.g. try searching for a flight between X and Y on a travel website, what you get is a table of results. There are times when we need to access elements (usually texts) that are within HTML tables. In this article let’s see how to read data from a Web Table using Selenium.

Selenium Webdriver Tutorials Test Automation Framework Testing Tools

The Automation Galaxy of Selenium Webdriver tools

Selenium WebDriver makes direct calls to the browser using each browser’s native support for automation. It support multiple browsers, operating systems and programming languages. What’s more? It’s FREE, ‘Open Source’ as we call it! Why do you think it’s so popular? 😉 Though Selenium Webdriver is at the epicenter of automated software testing, it is supported by different tools to make Automation Testing easy, effective & efficient – The Automation Galaxy of Selenium Webdriver tools!

Selenium Webdriver Tutorials

Download a file with Selenium Webdriver using Firefox Profile

While scripting you might encounter a scenario which requires the automation script to download a file with Selenium Webdriver (say MS Excel, MS Word, Zip file, PDF, CSV, Text file) from web application. What happens when you click on ‘Download’? Yeah! A pop-up window is displayed asking user to either open, save or ‘save as’ the file. If you have noticed, this is NOT a browser HTML pop-up but Windows OS pop-up. And Selenium Webdriver is a ‘Web Browser’ automation tool, i.e. it works only in the browser. We cannot access operating system’s native windows with Selenium Webdriver. Ooops! A blocker! Does this mean we cannot automate the File download scenario? Nah! It simply means we need to find a workaround 😉 In this article let’s explore how to download a file with Selenium Webdriver using Firefox Profile.

Selenium Webdriver Tutorials

Double click event in Selenium Webdriver using Actions class

In earlier post, we learnt how to replicate (or automate) keyboard and mouse actions in Selenium Webdriver. Selenium Webdriver provides an Advanced User Interaction API (including Actions class) which facilitate user actions to be performed in an application, i.e. users can use this API to simulate keyboard and mouse actions in Selenium Webdriver. In this tutorial we will see how to simulate Double click event in Selenium Webdriver using Actions class.

Selenium Webdriver Tutorials

11 Most common Exceptions in Selenium WebDriver

Everything is not easy at the beginning. Once you start your Selenium automation journey, you will frequently encounter certain exceptions in Selenium WebDriver. But don’t worry, we got you covered. It’s good to have a basic knowledge about 11 of the most common Exceptions in Selenium WebDriver which you may / may not encounter during the course of your test automation.

Selenium Webdriver Tutorials

How to capture Screenshot in Selenium Webdriver using Java

The basic rule of testing is to always take screenshot to base your claim. You can take screenshots at any stage of the test, but mostly, it is used for when a test fails and taking screenshots helps the analysis so we can see what went wrong during a test failure. The bugs you log should always have a screenshot attached to it. However, it is not necessary that screenshot should be taken only when you encounter a situation where expected result does not match the actual result. Screenshot are also taken as a proof that things are working fine. In this tutorial we will learn how to capture Screenshot in Selenium Webdriver using Java, i.e. TakesScreenshot class.

Selenium Webdriver Tutorials

driver.get in Selenium WebDriver

After successfully running several automation scripts now we are stepping towards grasping the essential ‘Get’ commands in Selenium. We will precisely and briefly discuss each of these Selenium commands so as to make you capable of using them effectively whenever required. Thus we are going to discuss about various driver.get in Selenium WebDriver that we would be using in our day to day automation testing. driver.get in Selenium WebDriver are used to collect various information about the page that we deal with. Here are some important “get” commands you must be familiar with,

Selenium Webdriver Tutorials

XPath Methods to identify Dynamic Web elements in Selenium

In our earlier post ‘Introduction To XPath | Selenium XPath Examples’ we learnt that XPath is one of the most popular element locator technique in Selenium along with CSS selector, i.e. mastering XPath methods or CSS is essential for the Selenium test automation. We learnt what is XPath, its syntax and types. In this article we will explore some powerful capabilities of XPath methods which open up many new methods for locating complex and even dynamic elements which in the end, make your scripts easier to maintain.

Many a times in automation, we either don’t have unique attributes of the elements or the elements are dynamically generated with the attribute’s value not known beforehand. For cases like these, XPath provide different methods of locating elements like – using the text written over the elements; using element’s index; using partially matching attribute value; by moving to sibling, child or parent of an element which can be uniquely identified etc.

Selenium Webdriver Tutorials

Introduction to XPath | Selenium XPath Examples

If you are somewhat familiar with Selenium automation, you would know the importance of XPath. For those who are just starting with Selenium – XPath is one of the most popular element locator technique in Selenium along with CSS selector, i.e. mastering XPath or CSS is essential for the Selenium test automation. Yeah! You can extract the XPaths from Firepath-like tools but these cannot be used directly for dynamic web elements. And we think getting the basics is a must >> Tools can be used afterwards. This article is an introduction to XPath along with some XPath examples.

Web page uses HTML Document Object Model. XPath is used to navigate & locate elements in an XML. So how are XPath examples relevant for a web page?

Selenium Webdriver Tutorials

Keyboard and Mouse Actions in Selenium Webdriver

What are the common ways you interact with an application? Yeah! The keyboard and mouse. Almost everything we perform in an application is via keyboard or a mouse – click, double-click, type, drag, mouse hover, right-click, etc. So here comes an obvious question for automation testing – How do you replicate (or automate) keyboard and mouse actions in Selenium Webdriver? As you might have guessed, every automation tool provides a way to script keyboard and mouse events. Selenium Webdriver provides an Advanced User Interaction API (including Actions class) which facilitate user actions to be performed in an application, i.e. users can use this API to simulate keyboard and mouse actions in Selenium Webdriver.

Selenium Webdriver Tutorials

How to handle frames in Selenium Webdriver

Occasionally you will encounter the below error when trying to locate an element. One of the reason might be that the element is present within a frame. And when writing a test against them, you can easily get tripped if you’re not paying attention. You cannot directly identify an element present in an iFrame. First we have to switch to the frame and then we can identify the elements present using normal Selenium locators. In this article let’s see how to handle frames in Selenium Webdriver.

Error:

Exception in thread “main” org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {“method”:”id”,”selector”:”tinymce”}

Interview Questions & Answers Selenium Webdriver Tutorials

Write a Java program | 5 commonly asked java-program in Selenium interview

As soon as you write Selenium Java in your resume, interviewer is bound to give you a sheet of paper & ask write a Java program. Though Selenium doesn’t require extensive Java knowledge but still there is a set of basic Java programs that you should be able to write on-the-spot. This article covers five of the most popular Write a Java program questions frequently asked in the technical interview. The questions are easy, but don’t forget to mark these java-program in your to do list before attending any technical interview for Selenium automation testing.

Selenium Webdriver Tutorials

Selenium WebDriver Wait commands | Different types of wait in Selenium Webdriver

Today most of the web applications are developed using Ajax and Javascript, i.e. the elements within the page might load at different time intervals. What if you write a Selenium WebDriver script just to encounter “ElementNotVisibleException” or “NoSuchElementException”? Yeah! It can be frustrating. This happens when WebDriver tries to identify an element that is still not loaded (or visible). We call it as “Sync issue” in automation. How to avoid the rework? Simple, wait for ‘some’ time during execution until elements are properly loaded or are visible in the webpage. It is NOT recommended to use Thread.Sleep() while testing or building the framework. So how do you wait in Selenium Webdriver? What are the Selenium WebDriver Wait commands? Let’s understand the different types of wait in Selenium Webdriver – Implicit, Explicit and Fluent Wait!