Tag Archives: java

TestNG annotations

Below is the list of annotations in TestNG. @BeforeTest @AfterTest @BeforeMethod @AfterMethod @BeforeSuite @AfterSuite @BeforeGroups @AfterGroups @BeforeClass @AfterClass @Test @BeforeTest: Executes before any method in a class which is having @Test annotation. @AfterTest: Executes after any method in a class which is having @Test annotation. @BeforeMethod: Executes every time before any test method in a… Read More »

How to handle mouse hover events using Selenium WebDriver

In this article, we will learn about how to handle the mouse hover events using selenium webdriver. Firstly, we have to hover mouse over the menu item. This displays the dropdown list/sub menu items. Next, we have to select the sub elements from the list and have to click on one of the sub element.… 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 »

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 »

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 »