Category Archives: Uncategorized

general selenium questions

1. Find element using xpath and cssSelector. Html code: <a class=”shopicon relative”>Shopping</a> Solution:  //a[@class=’shopicon relative’]   –> using xpath in firefox .shopicon.relative   –> using cssSelector in chrome //a[text()=’Shopping’] –> text() method 2. In the “in.rediff.com” website, ways to find NEWS link are: Using cssSelector: .navbar>:nth-child(1)>:nth-child(2) .navbarul>:nth-child(2) Using xpath: //a[text()=’NEWS’]

TestNG

TestNG is a test automation framework emerged to overcome the limitations of both JUnit and NUnit. It has many new features which are more powerful and easy to use. Annotations. Multithread safe tests. Data driven testing. Parameterization support. TestNG supports a different variety of tests like unit, integration, system, functional and end to end. Setup… Read More »

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 »

Selenium Interview Questions

Selenium Interview Questions: ADP Written test questions: 1. How to find inner text using CSS attribute. Options: css=tag:attribute (“inner text”); etc. 2. How to find words starting with ADP using CSS. Below are the few options. tag:attribute(“starts-with@id, “ADP”); tag:attribute(“@id, “ADP”); etc. 3. A question about Actions element. 4. Context click is used for ? Options:… 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 »

How to convert string to int in java

In this article you are going to learn, how to convert string to int in Java. parseInt valueOf NumberFormatException 1. Integer.parseInt(): String str = “50”; int num= Integer.parseInt(str); System.out.println(num); Output: 50 Info: It parses the string argument as a decimal integer. All characters in the string must be integers. Otherwise it will throw NumberFormatException. 2.… Read More »

profiling in selenium webdriver

Firefox options and profiling in Selenium WebDriver: //How to remove log statements in console: System.setProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE,”null”); //Set binary path of a browser FirefoxOptions fo = new FirefoxOptions(); fo.setBinary(“path to exe”); //page load strategy fo.setPageLoadStrategy(PageLoadStrategy.NONE); //or fo.setPageLoadStrategy(PageLoadStrategy.EAGER); //or //Tell selenium to launch specific firefox profile //First, Exit the firefox (Don’t click on cross button to close the… 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 »

encapsulation in java

Please read about java encapsulation from below link. encapsulation in java Tags: java encapsulation, encapsulation in java, java interview questions, oops concept encapsulation, oops in java, what is encapsulation in java, encapsulation, java, java semaphore, semaphore in java, java static class, what does encapsulation mean, encapsulation in oops, code encapsulation

difference between list set and map in java

List, Set and Map are the interfaces which implements Collection interface. Lets discuss the differences between List, Set and Map in Java. List Vs Set Vs Map: 1) Duplicity: List allows duplicate elements. Any number of duplicate elements can be inserted into the list. It doesn’t affect the previous values and indexes. Set doesn’t allow duplicate… Read More »

scroll up and down in selenium webdriver

In this article, you are going to learn how to scroll up or down or horizontally using Selenium WebDriver and java script. Java script executor syntax: 

  We can scroll in the page in below ways. 1 Scroll by Pixel 2 Scroll to the bottom of the page 3 Scroll until the element is… Read More »

Oracle hiring Java developers

Post date: 17-12-2018 Java developers recruitment: Oracle is hiring candidates for Java developer positions. Please check below requirements and apply if your profile matches. Experience: 1-3 years Should have sound knowledge on core java concepts. SQL/PLSQL is an added advantage. Analytical and problem solving skills. Location: Hyderabad   Post date: 19-09-2018 (Expired) Java developers recruitment:… Read More »

Mutual Funds

SBI Small Cap fund is back: One of the best small cap mutual fund which has given around 40-60% returns in a year at times is back. The SBI Small & Midcap Fund was suspended for new investments in Oct 2015 and now, it is open for new subscriptions. Customers who want to purchase the… Read More »

Calculate your profits through online calculator

Online profit calculator – Cryptocurrency Use below calculator to calculate your profits/loss in crypto currencies like Bitcoin(BTC), Ripple (XRP), Ether (ETH), Litecoin (LTC), Bitcoin cash (BCH) and Stellar (XLM) etc. This online profit calculator helps you to foreseen your investment ideas.   Profit calculator