Home Java Overview Maven Tutorials

Thursday, 28 May 2020

How to Handle Tool Tip in selenium

Hello friends
In this Article we will learn that how to handle the tooltip operation in selenium, so while automating your website you will get 2 kind of below scenarios :-
1). Tool tip in title tag :- We will use getAttribute("title")

2). Tool tip inside div or any other html tag :- we will use here actions class.
Here is the code for both

import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

public class Tooltiptest {
WebDriver driver;
public void g() throws InterruptedException
/*System.setProperty("", "D:\\Selenium\\Complete selenium\\ChromeDriver\\83\\chromedriver.exe");
System.setProperty("", "true");
driver = new ChromeDriver();*/
System.setProperty("webdriver.gecko.driver", "D:\\Selenium\\geckodriver\\new\\geckodriver.exe");
System.setProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE, "null");
driver = new FirefoxDriver();
public void gettootltip() throws InterruptedException
WebElement tootipelement = driver.findElement(By.className("tooltip"));
Actions action = new Actions(driver);
String text = driver.findElement(By.className("tooltiptext")).getText();
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
WebElement element = driver.findElement(By.xpath("/html/body/form/input[1]"));
String text2 = element.getAttribute("title");

Wednesday, 22 April 2020

Difference Between Collection & Collections

Difference between Collection & Collections

Difference between Collection and Collections

1). Collection is a root level Interface in Java Collection Framework or collection hierarchy. The Set, List and Queue are the some of the subInterfaces of Collection interface.

The important methods of Collection interface are add(), remove(), size(), clear() etc.

Collections is a utility class in java.util package which contains only static methods that operate on objects of type collection.

Collections class contains only static methods like sort(), min(), fill(), copy(), reverse() etc.

2). Before Java 8, interface was not allowed to contain static methods. collection is an Interface & interface can contain static methods since java 8 and Interface can also contain abstract methods and default methods.

But collections class contains only static methods.

3). Collection interface extends iterable interface

public interface Collections extends Iterable

and Collections class extends Object class

public class Collections extends Object

Similarities between Collection and Collections in Java

1). Both are part of the Java Collections Framework.

2). Both are present in java.util package

3). Both are added to jdk in java version 1.2

Example of Collections

import java.util.ArrayList;
import java.util.*;

public class ConsTest
public static void main(String args[]) throws IOException
ArrayList alist = new ArrayList();
System.out.println("maximum value" + " " + Collections.max(alist));
System.out.println("maximum value" + " " + Collections.min(alist));
ArrayList list = new ArrayList();
System.out.println("Sorted Strings" + " " + list);
Collections.sort(list, Collections.reverseOrder());
System.out.println("Reversed Strings" + " " + list);
ArrayList slist = new ArrayList(3);
ArrayList dlist = new ArrayList(3);
Collections.copy(dlist, slist);
Collections.fill(dlist, "way2testing");

Output :-

maximum value 45
maximum value 5
Sorted Strings [Cha, Chandan, Chauhan]
Reversed Strings [Chauhan, Chandan, Cha]
[Chandan, Chauhan, Cha]
[way2testing, way2testing, way2testing]

Friday, 10 April 2020

Static and Dynamic Testing


:- QA Vs QC

:- Verification V/s Validation

:- Static V/s Dynamic Testing

:- Review, Walkthrough & Inspection


:-QA is process related                       QC is the actual testing of the software

:-QA focuses on building in quality                        QC focuses on testing for quality

:-QA is preventing defects                        QC is detecting defects

:-QA is process Oriented                        QC is product Oriented.

:-QA is for entire life Cycle                        QC is for testing part in SDLC

:-QA focuses on building quality                       QC focuses on testing for quality and hence detecting defects

and hence preventing defects

:-Quality Assurance makes sure                        Quality control makes sure the results of what you done you are doing the right things, are what you expected.

the right way. fit for purpose & right first time                     to achieve Reliability, maintainability & safety

Verification V/s Validation

Verification checks whether we are building the right system

Verification is a process of finding out the product being developed the right way?

Verification typically involves




:- Buddy Check

Validation checks whether we are building the System Right

Validation is a process of finding out if the product being developed is right?

-- Generally Takes place after verification are completed

-- Validation typically involves actual Testing Like System Testing.

Reviews :-

Conducts on documents to ensure correctness and completeness.

Examples :-

:- :- Requirement Reviews

:- :- Design Reviews

:- :- Code Reviews

:- :- Test Plan Reviews

:- :- Test Cases Reviews etc.

Phases of Review :-

:- :- Planning

:- :- Kick-off

:- :- Preparartion

:- :- Review Meeting

:- :- Rework

:- :- follow up

Walkthroughs :-

:- :- It is a formal review and we can discuss/raise the issue at peer level.

:- :- Also walthrough does not have minutes of the meeting/meet. It can happen at any time and conduct just like that no schedule as such.

Inspections :-

:- :- It is a formal approach to the requirements schedule.

:- :- At lest 3-6 people will sit in the meeting 1-reader 2- writer 3- moderator plus concerned.

:- :- Inspection will have a proper schedule which will be intimated via email to the concerned developer/Tester.

Buddy Check :-

One person goes through the documents prepared by another person in order to find out if that person has made mistakes i.e. to find out bugs which the author couldn't find previously.

Static V/s Dynamic Testing

:- Static testing is an approach to test project documents in the form of

:- :- Reviews

:- :- Walkthroughs

:- :- Inspections

Dynamic Testing is an approach to the actual Software by giving inputs & performing operation and observing results.

Wednesday, 1 April 2020

Drag and Drop Test

Drag and Drop

Drag the image back and forth between the two div elements.

Friday, 10 January 2020

Path Practice Page

Drag and drop HTML5 demo

Try to drag the purple box around.

Drag Me


Drag the way2test image into the rectangle: