Posts

Showing posts from March, 2024

Heleanium - Web without using Docker

Image
 Heleanium - Web without using Docker Official Heleanium Website: https://healenium.io/docs/overview Youtube Video Link : https://www.youtube.com/watch?v=EF2gM16TnJg 1. We need install first :  Java 11+ , Python ( 3.12.0 )&  PostgreSQL ( prefer to use latest 16 version ) 2. Once PostgersSQL installed ( make sure during installation whatever you put the password for the same you remember / noted down, need this is in 3rd step), open SQL Shell ( psql ) from the applications, as shown below: 3. Once you open the Shell , hit ENTER till Username & provide same Password as in the step 2.  4. Now , feed one by one on the above terminal, this will create the DB ,  User & Schema for you: 4.1 : CREATE DATABASE healenium;      4.2 : CREATE USER healenium_user WITH ENCRYPTED PASSWORD 'YDk2nmNs4s9aCP6K' ;      4.3 : GRANT ALL PRIVILEGES ON DATABASE healenium TO healenium_user;      4.4 : ALTER USER healenium_user WITH SUPERUSER;      4.5 : \c healenium hea

How to interact an Element which is on iFrame on top of that its under Shadow-DOM :)

 How to interact an Element which is on iFrame on top of that its under Shadow-DOM :)  < 03/23: Under Writing > We can see from the below DOM , the elements for Destiny & Closed is on iFrame and which is under Shadow-DOM import org.openqa.selenium.By ; import org.openqa.selenium.JavascriptExecutor ; import org.openqa.selenium.WebDriver ; import org.openqa.selenium.WebElement ; import org.openqa.selenium.chrome.ChromeDriver ; public class TestingiFrameUnderShadowDOM { public static void main (String[] args) throws InterruptedException { WebDriver driver = new ChromeDriver() ; driver.get( "https://selectorshub.com/iframe-in-shadow-dom/" ) ; driver.manage().window().maximize() ; Thread. sleep ( 5000 ) ; JavascriptExecutor js = (JavascriptExecutor) driver ; WebElement iFrameEle = (WebElement) js.executeScript( "return document.querySelector('#userName').shadowRoot.querySelector('iframe#pact1')"

How to interact an Element under Shadow-DOM

Image
 Hello , in this blog I will show you to how to interact with an elements which is under under Shadow DOM / Shadow Root. In HTML, the Shadow DOM (Document Object Model) is a way to encapsulate the structure, style, and behavior of a web component. It allows a component to have its own isolated DOM tree and styles, separate from the rest of the page. This isolation prevents styles and scripts outside the component from affecting it, and vice versa, providing better modularity and encapsulation in web development. Lets say in the below Example: chrome://downloads/ The search input field is under shadow DOM in HTML  Copy JS path and paste on Console Now use as an element and test whether it allowed to setAttribute ( ) or not If the above works then we are good to use that in our script... import org.openqa.selenium.By ; import org.openqa.selenium.JavascriptExecutor ; import org.openqa.selenium.WebDriver ; import org.openqa.selenium.WebElement ; import org.openqa.selenium.chrome.ChromeDriv