Tag Archives: selenium

Selenium

Introduction: Selenium Tutorials: Selenium is a free and open source test automation tool for testing web applications. Selenium can be installed on most of the operating systems like Windows  Linux  Apple iOS   etc. Cross browser testing is possible using selenium i.e., we can run the test scripts in different browsers like Firefox  IE  Chrome  Opera … Read More »

How to handle alerts in Selenium WebDriver

Selenium WebDriver is able to handle alerts in addition to the windows and frames. What is an alert? Alert is a popup or message box which displays on the screen. Alerts can appear on the screen due to various user actions. For example, alert can appear when you click on a button or trying to… Read More »

Difference between while and do while loop in java

Difference between while and do while loop in java: while loop do while loop Checks the condition before executing the statement. It first executes the statement and then checks the condition. Entry controlled loop. Exit controlled loop. Condition comes before the body. Condition comes after the body. Statement(s) are executed at least once. Example: int… Read More »

auto suggestive dropdown selenium webdriver – Practice question 1

Topic: How to select an option from auto suggestive dropdown in a website. Below code is the solution for the 1st question present in the page. package com; import static org.testng.Assert.fail; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class AutoSuggestionDropdown { static WebDriver driver = null; public static void… Read More »

selenium-interview-questions-2

Selenium Interview Questions: 1. Question on xpath. Parent child traversing. Lets consider we have 1 parent element and 3 child elements. Write a xpath to identify the 2nd child element using 1st child element? Selenium Testing Selenium WebDriver Selenium Automation Solution: //*[@id=’id1′]/following-sibling::li[1] Explanation: If you give the xpath ‘//*[@id=’id1′]‘ in firepath or chropath, 1st child… Read More »