Skip to content

Make Selenium Easy

And Keep It That Way

  • Home
  • Share
  • Toggle search form

Make Selenium Easy – Page 4

Posted on 02/03/2020 By admin

As a part of TestNG Tutorials, in this post we will see a new feature provided by TestNG called Dry run of test methods. You may heard of the term “Dry Run” in Cucumber. If you want to check that every step in a feature file has its corresponding step definitions, we can run feature … Continue reading TestNG Tutorials 65 : Dry Run Feature in TestNG

As a part of End to End REST Assured Tutorial , in this post We will learn about “BDD Style in REST Assured”. BDD is an agile software development process (Not a Software Testing process) which defines expectation from an application to behave from intended user prospective. Each scenario is written in form of Given … Continue reading REST Assured Tutorial 8 – BDD Style in Rest Assured

Company Name :- UST GlobalDate :- Nov – 2019Experience Level: – 2 – 5 YearsLocation- BengaluruMode : – F2F 1. What is the main difference between xpath and css selector?2. If there 4 frames in the application . How will you get the 4rth frame ID.3. If there is a ok button. How many ways … Continue reading Interview Experience at UST Global Bangalore for Automation Testing Profile – Nov – 2019

As a part of End to End REST Assured Tutorial , in this post We will learn about “Builder pattern in Java and how REST Assured uses it”. If you refer any tutorial or official website of Rest Assured, they start with an examples as below:-

@Test public void lotto_resource_returns_200_with_expected_id_and_winners() { when(). get(“/lotto/{id}”, 5). then(). statusCode(200). body(“lotto.lottoId”, equalTo(5), “lotto.winners.winnerId”, hasItems(23, 54)); }

lotto_resource_returns_200_with_expected_id_and_winners() {             body(“lotto.lottoId”, equalTo(5),                  “lotto.winners.winnerId”, hasItems(23, 54));

Beginners may confuse easily with syntax. THe purpose of … Continue reading REST Assured Tutorial 7 – Builder Pattern in REST Assured

In previous post, we learnt to Retrieve text from a list of web elements using Java Stream APIs. You may require just to retrieve unique text only. We used a List in previous post which allows duplicates. We can just use a Set to avoid duplicates. Java Code:-

package RealtimeValdationAutomationTesting; import java.util.HashSet; import java.util.Set; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.annotations.Test; import io.github.bonigarcia.wdm.WebDriverManager; public class RetrieveUniqueTextFromListOfElementUsingStreamAPICollect { @Test public void RetrieveTextFromListOfElementWithStremAPI() { // Auto setup of chrome executable file WebDriverManager.chromedriver().setup(); // Launching browser WebDriver driver = new ChromeDriver(); // Load the URL driver.get(“http://automationpractice.com/index.php”); // Creating a Set to store only unique names Set uniqueProductName = new HashSet(); // Locating all product names at home page driver.findElements(By.xpath(“//ul[contains(@class,’active’)]//a[@class=’product-name’]”)) .stream() .forEach(product -> uniqueProductName.add(product.getText())); // Print count of product found System.out.println(“Total unique product found : “+uniqueProductName.size()); // Printing product names System.out.println(“All product names are : “); uniqueProductName.forEach(name -> System.out.println(name)); // closing the browser driver.quit(); } }

package RealtimeValdationAutomationTesting; import java.util.HashSet; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.annotations.Test; import io.github.bonigarcia.wdm.WebDriverManager; public class RetrieveUniqueTextFromListOfElementUsingStreamAPICollect { public void RetrieveTextFromListOfElementWithStremAPI() // Auto setup of chrome executable file WebDriverManager.chromedriver().setup(); WebDriver driver = new ChromeDriver(); driver.get(“http://automationpractice.com/index.php”); // Creating a Set to store only unique names Set uniqueProductName = new HashSet(); // Locating all product names at home page driver.findElements(By.xpath(“//ul[contains(@class,’active’)]//a[@class=’product-name’]”)) .forEach(product -> uniqueProductName.add(product.getText())); // Print count of product found System.out.println(“Total unique product found : “+uniqueProductName.size()); // Printing product names System.out.println(“All product names are : “); uniqueProductName.forEach(name -> System.out.println(name));

Output:-

Total unique product found : 5 All product names are : Printed Dress Blouse Printed Chiffon Dress Faded Short Sleeve T-shirts Printed Summer Dress

Total unique product found : 5 Faded Short Sleeve T-shirts

You must be thinking … Continue reading Usage of Java Stream API in Selenium – Retrieving Unique Text From a List Of WebElements

Stream API is the major feature introduced in Java 8. As an automation tester, if you think you don’t have to learn about it, you may be wrong. Yes you don’t need to know everything but little basic knowledge of Stream API will help you to reduce lines of code in Selenium script. I am … Continue reading Usage of Java Stream API in Selenium – Retrieving Text From a List Of WebElements

Company Name :- HCLDate :- Aug – 2019Experience Level: – 2 – 4 YearsLocation- BengaluruRounds :- 2Mode : – F2F There were many candidates , so I got my chance after 90 mins. There were total 2 rounds. Both were technical and most of the questions were basics from Manual testing, Java , Selenium and … Continue reading Interview Experience at HCL Bangalore for Manual & Automation Testing Profile – Aug-2019

As a part of End to End REST Assured Tutorial , in this post We will learn about Interface in Java. I will strongly recommended you to go through the topic Abstraction – Hide the implementation before continuing this post. Let’s start with a real time example. You would be reading this post on a … Continue reading REST Assured Tutorial 6 – Interface in OOPS – Implement As You Wish

As a part of End to End REST Assured Tutorial , in this post We will learn about Abstraction in Java. If you are thinking why this topic is necessary , do not worry. I will connect all dots in upcoming posts. Abstraction is one of the pillar in Object Oriented Programming. Java is an … Continue reading REST Assured Tutorial 5 – Abstraction – Hide The Implementation

We have already learnt about all types of variables in Postman in Postman Series on my blog. This post will bring all concepts of variables together so that you can learn or revise your concepts at one place. A variable is a named memory space which is used to store and manipulate values. You can … Continue reading Postman Tutorial Part 48 – All Types of Variables in Postman

Uncategorized

Post navigation

Previous Post: console Error – Make Selenium Easy
Next Post: Make Selenium Easy – Page 5

Related Posts

Installation of JAVA, Eclipse and Selenium – Make Selenium Easy Uncategorized
July 2019 – Make Selenium Easy Uncategorized
firepathinfirefox – Make Selenium Easy Uncategorized
Protractor Tutorial 5 – Introduction & Installation of NodeJS Uncategorized
September 29, 2019 – Make Selenium Easy Uncategorized
January 10, 2018 – Make Selenium Easy Uncategorized

Recent Posts

  • Getting Started with Selenium 4: What Is New and How to Upgrade from Selenium 3
  • Manual Testing
  • Baby Steps To Become Efficient Selenium-Java Automation Tester
  • Features of Selenium 4.0.0 Release – Java Binding
  • Part 1: Handling Drop-down Created Using SELECT Tag In Selenium

Recent Comments

No comments to show.

Archives

  • April 2026
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • April 2024
  • March 2024
  • February 2024
  • December 2023
  • October 2023
  • August 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • May 2022
  • March 2022
  • October 2021
  • April 2021
  • March 2021
  • January 2021
  • December 2020
  • October 2020
  • September 2020
  • August 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • May 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • January 2018

Categories

  • Getting Started
  • Uncategorized

Copyright © 2026 Make Selenium Easy.

Powered by PressBook Masonry Dark