Posts

Generate Stunning HTML and Allure Reports with Playwright in TypeScript

Image
Are you looking for a way to visualize your Playwright test results with stunning HTML and Allure reports? Look no further! In this blog post, we'll walk you through the step-by-step process of setting up and generating both HTML and Allure reports for your Playwright automation project using TypeScript. Let's get started! Step 1: Install Necessary Packages First, we need to install the required packages. Open your terminal and navigate to your project directory. Run the following commands to install the Allure Playwright and HTML Reporters: npm install --save-dev @playwright/test allure-playwright playwright-html-reporter Additionally, install the Allure command line tool globally on your system: npm install -g allure-commandline Step 2: Configure Playwright Next, we need to configure Playwright to use both Allure and HTML reporters. Update your playwright.config.ts fil...

How to Take a Screenshot of a Webpage Using Selenium WebDriver in Java?

Image
How to Take a Screenshot of a Webpage Using Selenium WebDriver in Java Taking a screenshot of a webpage during automated testing is a common task that can help capture the state of the page at a particular moment. Selenium WebDriver, a widely used tool for web application automation, offers a simple way to do this. In this blog, we will explain how to take a screenshot of a webpage using Selenium WebDriver in Java. The Code Here’s the Java code for taking a screenshot using Selenium WebDriver: /** * This is a simple Java program that demonstrates how to take a screenshot * of a webpage using Selenium WebDriver. */ public class ScreenshotExample { /** * Main method that initializes the WebDriver, opens a webpage, and takes a screenshot. * * @param args Command-line arguments (not used in this example). */ public static void main(String[] args) { ...

How to launch the chrome browser without chromedriver.exe (only for Maven)

Image
Selenium WebDriver is the most used automation tool these days. Selenium WebDriver  interacts with different browsers like Chrome, Firefox, and Internet Explorer to run various types of tests. In short Selenium WebDriver is a popular automation tool for cross-browser testing. Cross-browser automation testing requires Selenium to interact with the browser for which the script is to be run. To interact browser, you must download the driver.exe file according to the browser. Example: You want to run your automation script in the Chrome browser. So you have to download the chromedriver.exe file into your local system and then you have to set the path of that chromedriver.exe to your automation script. set chromedriver.exe path: String driverPath= "write here your chromeDriver path"; System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir")+pathDriver); Create chromerdriver instance: WebDriver driver = new ChromeDriver(); get() method to ope...

Handle bootstrap date picker using selenium java

Image
Select date " 4/mar/2021" from the calendar Step 1: Open this URL in your chrome browser and run this URL for demo date picker https://www.seleniumeasy.com/test/bootstrap-date-picker-demo.html   Step 2: Copy the xpath of date picker element xpath =  //*[@id="sandbox-container1"]/div/span/i Step 3: Copy the xpath of  element from where we will year and month table xpath = /html/body/div[3]/div[1]/table/thead/tr[2]/th[2]  Step : 4 Copy the xpaths of  year table, month table and date table Year table xpath = /html/body/div[3]/div[3]/table/tbody  Moth table xpath = /html/body/div[3]/div[3]/table/tbody/ Date table xpath = /html/body/div[3]/div[1]/table/tbody Sample example Code : package com.qatips; import java.util.List; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; public class SelectDate { static WebDriver driver; public static void main(String...