Skip to main content

Posts

Showing posts from October, 2024

LetXPath

LetXPath: Your Ultimate XPath & CSS Selector Finder LetXPath is an open-source project designed to help you find XPath and CSS selectors with a single click, complete with code snippets tailored to the element type. You tube Video ::   LetXpath How to Use LetXPath?  1. Install the Extension: After installation, restart your browser. 2. Navigate to the Desired Page: Open the page from which you want to extract XPath. 3. Open DevTools: Click on the inspect window or press `F12` (Function `F12`). 4. Access LetXPath: Open the LetXPath menu from the sidebar panel. 5. Get Your XPath: Click on the desired element to obtain its XPath. Features  1. Single-Click XPath: Obtain the best XPath with just one click. 2. Smart XPath Generation: Generates XPaths based on direct elements or parent-child relationships. 3. Dynamic XPaths: Supports dynamic XPaths, including relationships like `following`, `following-sibling`, `preceding`, and `preceding-sibling`. 4. Axis-Based XPaths: Crea...

How to Automate Browser Refresh ,Back and Forward Action On Page using Playwright Java

 How to Automate Browser Refresh ,Back and Forward Action On Page  using Playwright Java  Steps 1. Refresh on Page Action 2.Navigate to Previous Page by click on Browser 'Back' button 3.Navigate to Forward Page by click on Browser 'Forward' button  package com.example.pr; import com.microsoft.playwright.*; public class BrowserButtonNavigationExample { public static void main (String[] args) throws InterruptedException { Playwright playwright = Playwright. create (); Browser browser = playwright.chromium().launch( new BrowserType.LaunchOptions() .setHeadless( false ) .setChannel( "chrome" ) ); Page page = browser.newPage(); page.navigate( "https://qa-practice.netlify.app/checkboxes" ); Locator checkbox = page.locator( "[type='checkbox']" ); checkbox.nth( 2 ).click(); Thread. sleep ( 5000 ); // refresh page page.reload()...

How to Automate Checkbox On Page using Playwright Java

 How to Automate Checkbox On Page  using Playwright Java  1. Click on method 2. Check method . example page.check("selectors") 3.Un check method example page.uncheck("selectors") package com.example.pr; import com.microsoft.playwright.*; public class CheckBoxesExample { public static void main (String[] args) throws InterruptedException { Playwright playwright = Playwright. create (); Browser browser = playwright.chromium().launch( new BrowserType.LaunchOptions() .setHeadless( false ) .setChannel( "chrome" ) ); Page page = browser.newPage(); page.navigate( "https://qa-practice.netlify.app/checkboxes" ); Locator checkbox =page.locator( "[type='checkbox']" ); for ( int i= 0 ;i< checkbox.count();i++){ checkbox.nth(i).click(); } } }

How to Automate Links On Page using Playwright Java

 How to Automate Links On Page  using Playwright Java  1.Print All link on the page 2.Block of the page link to be print  package com.example.pr; import com.microsoft.playwright.*; public class LinksExample { public static void main (String[] args) throws InterruptedException { Playwright playwright = Playwright. create (); Browser browser = playwright.chromium().launch( new BrowserType.LaunchOptions() .setHeadless( false ) .setChannel( "chrome" ) ); Page page = browser.newPage(); page.navigate( "https://ultimateqa.com/automation" ); Locator pagelinks = page.locator( "a" ); System. out .println( "Total link on page ---" + pagelinks.count()); for ( int i = 0 ; i < pagelinks.count(); i++){ System. out .println(pagelinks.nth(i).innerText()+ " Print HREF attribute associated to Links ==" + pagelinks.nth(i).getAttribute( "h...

How to Automate Dropdown List using Playwright Java

How to Automate Dropdown List using Playwright Java Different way handle Dropdown List using Playwright Java 1. Select By Value 2.   Select By Text 3.   Select By Index 4.   Get Locator and get using nth element  5.   Get All Locators in List<ElementHandle> using querySelectorAll package com.example.pr; import com.microsoft.playwright.*; import com.microsoft.playwright.options.SelectOption; import java.util.List; public class DropDownlistExample1 { public static void main (String[] args) throws InterruptedException { Playwright playwright = Playwright. create (); Browser browser = playwright.chromium().launch( new BrowserType.LaunchOptions() .setHeadless( false ) .setChannel( "chrome" ) ); Page page = browser.newPage(); page.navigate( "https://qa-practice.netlify.app/dropdowns#some-action" ); // Select By Value page.selectOption( "select" , "India...